Welcome to Harbour
==================
Clipper is a trademark of Computer Associates and will often be
referred to as CA-Cl*pper within Harbour documents. Regardless of this
variant, Clipper is recognized as Computer Associates' trademark.
Harbour is a free software compiler for the xBase superset language often
referred to as Clipper (the language that is implemented by the compiler
Clipper). The goal of the Harbour project is to produce a cross platform
CA-Cl*pper compatible compiler.
The Harbour web site is at . If you
have any problems with this copy of Harbour please visit our web site and
ensure that you are using the latest release.
If you have any questions about Harbour please be sure to read the FAQ
. Also, please be sure to read the
documentation that comes with Harbour, you should find it in the same
directory in which you found this file.
If you are reading this file as part of a source distribution of harbour you
probably want to start by reading dirstruc.txt because this is your map to
the harbour source directories.
Harbour is a superset of Clipper and is backwards compatible with nearly
100% of all Clipper 5.2x or 5.3 code. Most Clipper S'87 code will also
compile and run fine, but may require some modifications to run well.
Examples:
Status:
Compliance:
Files:
See also:
@...Get
Lang:
sayget.txt
Component:
harbour
Doc. source:
.\doc\en\sayget.txt
Template:
Command
Category:
Command
Subcategory:
User interface
Oneliner:
Creates a GET object and displays it to the screen
Syntax:
@ , [SAY [PICTURE ] COLOR ]
GET [PICTURE ] [WHEN ] [COLOR ]
[VALID / RANGE ,]
Arguments:
The row coordinate.
The column coordinate.
Message to display.
Character expression of PICTURE displayed.
Color to be Used for the SAY expression.
An variable/field name.
Character expression of PICTURE to get.
Logical expression to allow GET.
Logical expression to validate GET input.
Lower RANGE value.
Upper RANGE value.
Color string to be used for the GET expression.
Returns:
Description:
This command adds a GET object to the reserved array variable
named GETLIST[] and displays it to the screen. The field or variable
to be added to the GET object is specified in and is displayed
at row, column coordinate , .
If the SAY clause is used will be displayed starting at
,, with the field variable displayed at ROW(),
COL()+ 1. If , the picture template for the SAY expression
, is used, all formatting rules contained will apply See the
TRANSFORM I function for further information.
If is specified, the PICTURE clause of will be
used for the GET object and all formatting rules will apply. See
the table below for GET formatting rules.
If the WHEN clause is specified,when evaluates to a logical
true (.T.) condition, the GET object will he activated otherwise the
GET object will be skipped and no information will be obtained via
the screen. The name of a user-defined function returning a logical
true (.T.) or false ( F.) or a code block may be ,specified in
This clause not activated until a READ command or READMODAL()
function call is issued.
If the VALID clause is specified and evaluates to it logical
true (.T.) condition the current GET will be considered valid and
the get operation will continue onto the next active GET object. If
not, the cursor will remain on this GET object until aborted or
until the condition in evaluates to true (.T.). The name
of a user-defined function returning a logical true (.T.) or false
(.F.) or it code block may be specified in . This clause is
not activated until a READ command or READMODAL( ) function call is
issued.
If the RANGE clause is specified instead of the VALID clause, the
two inclusive range values for must be specified in
and . Id is a date data type, and must
also be date data types; if is a numeric data type
and must also be numeric data types. If a value fails the
RANGE test ,a message of OUT OF RANGE will appear in the SCOREBOARD
area (row = 0, col = 60). The RANGE message may be turned off it the
SET SCOREBOARD command or SET() function appropriately toggled.
NOTE GET functions/formatting rules:
@A Allows only alphabetic characters.
@B Numbers will be left justified
@C All positive numbers will be followed by CR.
@D All dates will be in the SET DATE format.
@E Dates will be in British formal: numbers in European format.
@K Allows a suggested value to be seen within the GET
area but clears It if any non cursor key is pressed when
the cursor is in the first Position in the GET area.
@R Non template characters will be inserted.
@S Allows horizontal scrolling of a field or variable that
is characters wide.
@X All negative numbers will be followed by DB
@Z Displays zero values as blanks.
@! Forces uppercase lettering
@( Displays negative numbers in parentheses with leading spaces.
@) Displays negative numbers in parentheses without leading spaces.
GET templates/formatting rules:
A Only alphabetic characters allowed.
N Only alphabetic and numeric characters allowed
X Any character allowed.
L Only T or F allowed For logical data.
Y Only Y or N allowed for logical data.
9 Only digits, including signs, will be allowed.
# Only digits, signs. and spaces will he allowed.
! Alphabetic characters are converted to Uppercase.
$ Dollar will be displayed in place of leading
spaces for numeric data types.
* Asterisk,, will Be displayed in place of leading spaces
for numeric data types.
. Position of decimal point.
, Position of comma.
Format PICTURE functions may he grouped together as well as used
in Conjunction with a PICTURE templates;however, a blank space must
be included in the PICTURE string if there are both functions and
templates.
Examples:
PROCEDURE Main()
LOCAL cVar := Space( 50 )
LOCAL nId := 0
CLS
@ 3,1 SAY "Name" GET cVar PICTURE "@!S 30"
@ 4,1 SAY "Id" GET nId PICTURE "999.999"
READ
? "The name you entered is",cVar
? "The id you entered is",nId
RETURN
Status:
R
Compliance:
C
Files:
See also:
@...SAY,READ,TRANSFORM()
@...PROMPT
Lang:
menu.txt
Component:
harbour
Doc. source:
.\doc\en\menu.txt
Template:
Command
Category:
Command
Subcategory:
User interface
Oneliner:
Display a menu item on screen and define a message
Syntax:
@ , PROMPT [MESSAGE ]
Arguments:
is the row number to display the menu . Value could
range from zero to MAXROW().
is the column number to display the menu . Value
could range from zero to MAXCOL().
is the menu item character string to display.
define a message to display each time this menu item is
highlighted. could be a character string or code block that
is evaluated to a character string. If is not specified or
of the wrong type, an empty string ("") would be used.
Returns:
Description:
With @...Prompt you define and display a menu item, each call to
@...Prompt add another item to the menu, to start the menu itself
you should call the __MenuTo() function (MENU TO command). You can
define any row and column combination and they will be displayed at
the order of definition. After each call to @...Prompt, the cursor
is placed one column to the right of the last text displayed, and
ROW() and COL() are updated.
@...PROMPT command is preprocessed into __AtPrompt() function during
compile time.
Examples:
// display a two line menu with status line at the bottom
// let the user select favorite day
SET MESSAGE TO 24 CENTER
@ 10, 2 PROMPT "Sunday" MESSAGE "This is the 1st item"
@ 11, 2 PROMPT "Monday" MESSAGE "Now we're on the 2nd item"
MENU TO nChoice
DO CASE
CASE nChoice == 0 // user press Esc key
QUIT
CASE nChoice == 1 // user select 1st menu item
? "Guess you don't like Mondays"
CASE nChoice == 2 // user select 2nd menu item
? "Just another day for some"
ENDCASE
Displays data at specified coordinates of the current device.
Syntax:
@ , SAY [ PICTURE ] [COLOR ]
Arguments:
Row coordinate
Column coordinate
Value to display
PICTURE format
Color string
Returns:
Description:
This command displays the contents of at row column
coordinates , . A PICTURE clause may be specified
in . If the current device is set to the printer, the output
will go to the printer; the default is for all output to go to
the screen.
For a complete list of PICTURES templates and functions, see the
@...GET command.
Examples:
PROCEDURE Main()
CLS
@ 2, 1 SAY "Harbour"
@ 3, 1 SAY "is" COLOR "b/r+"
@ 4, 1 SAY "Power" PICTURE "@!"
RETURN
Status:
R
Compliance:
C
Files:
See also:
@...GET,SET DEVICE,TRANSFORM()
AADD()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Dynamically add an element to an array
Syntax:
AADD([, ]) --> Value
Arguments:
The name of an array
Element to add to array
Returns:
if specified , will return , otherwise this
function returns a NIL value.
Description:
This function dynamically increases the length of the array named
by one element and stores the value of to that
newly created element.
may be an array reference pointer, which in turn may be
stored to an array's subscript position.
Examples:
LOCAL aArray := {}
LOCAL x
AAdd( aArray, 10 )
FOR x := 1 TO 10
AAdd( aArray, x )
NEXT
// Result is: { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
Status:
R
Compliance:
C
Files:
Library is vm
See also:
AINS(),ASIZE()
ABS()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
API
Subcategory:
Math
Oneliner:
Return the absolute value of a number.
Syntax:
ABS() -->
Arguments:
Any number.
Returns:
The absolute numeric value.
Description:
This function yields the absolute value of the numeric value or
expression .
- topmost row used to display array (default 0)
- leftmost row used to display array (default 0)
- bottommost row used to display array (default MAXROW())
- rightmost row used to display array (default MAXCOL())
- the character array of items from which to select
- an array of items, either logical or character,
which is used to determine if a particular item
may be selected. If the type of a given item is
character, it is macro evaluated, and the result
is expected to be a logical. A value of .T. means
that the item may be selected, .F. that it may not.
(See next argument: lSelectableItems)
- a logical value which is used to apply to all
items in acMenuItems. If .T., all items may be
selected; if .F., none may be selected.
(See previous argument: alSelectableItems)
Default .T.
- the name of a function to be called which may
affect special processing of keystrokes. It is
specified without parentheses or parameters.
When it is called, it will be supplied with the
parameters: nMode, nCurElement, and nRowPos.
Default NIL.
- a codeblock to be called which may
affect special processing of keystrokes. It
should be specified in the form
{|nMode, nCurElemenet, nRowPos| ;
MyFunc(nMode, nCurElemenet, nRowPos) }.
Default NIL.
- the number of the element to be highlighted as
the current item when the array is initially
displayed. 1 origin. Default 1.
- the number of the window row on which the initial
item is to be displayed. 0 origin. Default 0.
Returns:
- the number of the item to be selected, or 0 if the
selection was aborted.
Description:
Allows selection of an element from an array.
Please see standard CA-Cl*pper documentation for ACHOICE for
additional detail.
Examples:
aItems := { "One", "Two", "Three" }
nChoice := ACHOICE( 10, 10, 20, 20, aItems )
IF nChoice == 0
? "You did not choose an item"
ELSE
? "You chose element " + hb_ntos( nChoice )
?? " which has a value of " + aItems[ nChoice ]
ENDIF
Status:
Compliance:
C
Files:
Library is rtl
See also:
MENU TO
ACLONE()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Duplicate a multidimensional array
Syntax:
ACLONE() --> aDuplicate
Arguments:
Name of the array to be cloned.
Returns:
A new array pointer reference complete with nested
array values.
Description:
This function makes a complete copy of the array expressed as
and return a cloned set of array values. This provides
a complete set of arrays values for all dimensions within the
original array
Examples:
LOCAL aOne, aTwo
aOne := { "Harbour"," is ","POWER" }
aTwo := AClone( aOne ) // Result: aTwo is {"Harbour"," is ","POWER"}
aOne[ 1 ] := "The Harbour Compiler"
// Result:
// aOne is { "The Harbour Compiler", " is ", "POWER" }
// aTwo is { "Harbour"," is ","POWER" }
Status:
R
Compliance:
CA-Cl*pper will return NIL if the parameter is not an array.
Files:
Library is vm
See also:
ACOPY(),ADEL(),AINS(),ASIZE()
ACOPY()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Copy elements from one array to another
Syntax:
ACOPY( , , [], [], [] ) --> aTarget
Arguments:
is the array to copy elements from.
is the array to copy elements to.
is the beginning subscript position to copy from the number of subscript elements to copy from .
the starting subscript position in to copy
elements to.
Returns:
an array pointer reference
Description:
This function copies array elements from to .
is the beginning element to be copied from ;
the default is 1.
is the number of elements to be copied from ;
the default is the entire array.
is the subscript number in the target array,,
to which array elements are to be copied; the default is 1
This function will copy all data types in to .
If an array element in is a pointer reference to another
array, that array pointer will be copied to ; not all
subdimensions will be copied from one array to the next. This must
be accomplished via the ACLONE() function.
Note:
If array is larger then , array elements will
start copying at and continue copying until the end
of array is reached. The ACOPY() function doesn't append
subscript positions to the target array, the size of the target
array remains constant.
The function ACOS() is the inverse function of COS(). It takes a
cosine value and returns the smallest(!) angle whose cosine equals to the argument.
The return value is given in radiants (full angle equals 2*Pi -
see DTOR() if you need to convert it into degress).
Note, that must be between -1 and 1 and that
is always between 0 and PI().
This function returns an array with all the days names in the
selected current language.
Examples:
aDays := ADays()
? aDays[1] -> Sunday
? aDays[1] -> Domingo (if the selected language is Spanish)
Status:
R
Compliance:
This function is new in Harbour.
Files:
Library is libmisc
See also:
ADAYS()
ADDASCII()
Lang:
addascii.txt
Component:
hbct
Doc. source:
hbct\doc\en\addascii.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Add an integer value to an ascii value of a string
Syntax:
ADDASCII (<[@]cString>, , [], []) --> cString
Arguments:
<[@]cString> is the string that should be edited
is a integer value that should be added to the
ASCII value of the character at the th position
[] is the position of the character that should be edited.
If not supplied, the last character of <[@]cString> is
edited.
[] NEW: is set to .T. if the substring from position 1 to
position should be treated as an integer
written to the base 256. Thus, the addition of
can affect to whole substring (see EXAMPLES).
Default is .F., the original behaviour of this function.
Returns:
The edited string is returned. The return value can be suppressed by
using the CSETREF() function. The string must then be passed by
reference [@].
Description:
ADDASCII() can be used to add or subtract integer values from
ASCII values in a string. The new parameter allows
to treat a string as an integer written to the base 256. Since
is limited to a signed long, only substrings 4 characters
long can be affected by one ADDASCII() call.
If the length of <[@]cString> is smaller than , the
string remains unchanged. The same happens, if uninterpretable
parameters are passed to this function.
Examples:
// Add 32 to the ASCII value of the character at the last position
// in the string
? addascii ("SmitH", 32) --> "Smith"
Status:
Ready
Compliance:
ADDASCII() is compatible with CT3's ADDASCII().
A new, 4th, parameter has been added who defaults to the original
behaviour if omitted.
Files:
Source is addascii.c, library is ct3.
See also:
CSETREF()
ADDMONTH()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
add months to a date
Syntax:
ADDMONTH ([,] ) -> dShiftedDate
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
ADDMONTH() is compatible with CT3's ADDMOTH().
Files:
Source is dattime2.prg, library is libct.
See also:
ADEL()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Delete an element form an array.
Syntax:
ADEL(, ) --> aTarget
Arguments:
Name of array from which an element is to be removed.
Subscript of the element to be removed.
Returns:
an array pointer reference.
Description:
This function deletes the element found at subscript position
in the array . All elements in the array below the
given subscript position will move up one position in the
array. In other words, what was formerly the sixth subscript position
will become the fifth subscript position. The length of the array
will remain unchanged,as the last element in the array will
become a NIL data type.
Examples:
LOCAL aArray := { "Harbour", "is", "Power" }
ADel( aArray, 2 ) // Result: aArray is { "Harbour", "Power" }
Status:
R
Compliance:
C
Files:
Library is vm
See also:
ACOPY(),AINS(),AFILL()
ADIR()
Lang:
dir.txt
Component:
harbour
Doc. source:
.\doc\en\dir.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Fill pre-defined arrays with file/directory information
Syntax:
ADIR( [], [], [], [],
[], [] ) --> nDirEnries
Arguments:
File mask to include in the function return. It could
contain path and standard wildcard characters as supported by your
OS (like * and ?). If you omit or if contains
no path, then the path from SET DEFAULT is used.
Array to fill with file name of files that meet .
Each element is a Character string and include the file name and
extension without the path. The name is the long file name as
reported by the OS and not necessarily the 8.3 uppercase name.
Array to fill with file size of files that meet .
Each element is a Numeric integer for the file size in Bytes.
Directories are always zero in size.
Array to fill with file last modification date of files that
meet . Each element is of type Date.
Array to fill with file last modification time of files that
meet . Each element is a Character string in the format
HH:mm:ss.
Array to fill with attribute of files that meet .
Each element is a Character string, see DIRECTORY() for information
about attribute values. If you pass array to , the function
is going to return files with normal, hidden, system and directory
attributes. If is not specified or with type other than
Array, only files with normal attribute would return.
Returns:
ADIR() return the number of file entries that meet
Description:
ADIR() return the number of files and/or directories that match
a specified skeleton, it also fill a series of given arrays with
the name, size, date, time and attribute of those files. The passed
arrays should pre-initialized to the proper size, see example below.
In order to include hidden, system or directories must be
specified.
ADIR() is a compatibility function, it is superseded by DIRECTORY()
which returns all the information in a multidimensional array.
Examples:
LOCAL aName, aSize, aDate, aTime, aAttr, nLen, i
nLen := ADir( "*.jpg" ) // Number of JPG files in this directory
IF nLen > 0
aName := Array( nLen ) // make room to store the information
aSize := Array( nLen )
aDate := Array( nLen )
aTime := Array( nLen )
aAttr := Array( nLen )
ADir( "*.prg", aName, aSize, aDate, aTime, aAttr )
FOR i := 1 TO nLen
? aName[ i ], aSize[ i ], aDate[ i ], aTime[ i ], aAttr[ i ]
NEXT
ELSE
? "This directory is clean from smut"
ENDIF
Status:
R
Compliance:
is going to be filled with long file name and not necessarily
the 8.3 uppercase name.
Files:
Library is rtl
See also:
ARRAY(),DIRECTORY(),SET DEFAULT
ADS Overview
Lang:
readme.txt
Component:
rddads
Doc. source:
rddads\doc\en\readme.txt
Template:
Category:
Document
Subcategory:
Oneliner:
Advantage Database Server RDD
Syntax:
Arguments:
Returns:
Description:
RDDADS is an RDD for the Advantage Database Server, an xBase data
server by Extended Systems .
The RDD was written by Alexander Kresin
Additional code and documentation was added by
Brian Hays .
Your Harbour application can access a remote database server for a
true client/server architecture, or it can use the "local server"
adsloc32.dll for stand-alone or even small network installations.
For using this RDD you need to have: ace32.dll ( Advantage Client Engine ), axcws32.dll ( communication layer for remote server ) or adsloc32.dll ( local server )
You need also to create ace32.lib with the help of implib.exe:
implib ace32.lib ace32.dll
For building executables don't forget to include the ace32.lib and
rddads.lib in the make file or link script.
You also need to include in your PRG file following lines:
REQUEST ADS
rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )
By default RDDADS is tuned for remote server and cdx indexes. To
change this you may use these commands defined in ads.ch:
SET SERVER LOCAL
SET SERVER REMOTE
SET FILETYPE TO NTX
SET FILETYPE TO ADT
SET FILETYPE TO CDX
or functions AdsSetServerType(), AdsSetFileType().
See the header file ads.ch for details.
Note that the default local server (adsloc32.dll) is useable for
file sharing on a small network. The default DLL is limited to
5 users, but an unlimited version is available from Extended Systems.
MAX OPEN TABLES: The server (even local) has its own setting for
Max Tables allowed open. For the Local Server, it can be set in
adslocal.cfg. The default is only 50!
For the Windows Remote Servers, use the Configuration Utility, or
increase the setting for the TABLES configuration value in the Advantage
Database Server configuration registry key using the Registry Editor.
For NetWare, edit the configuration file ads.cfg.
See ace.hlp under adslocal.cfg, or the Advantage Error Guide for
error 7005.
SPEED AND PERFORMANCE ISSUES
If you have sluggish browsers, one issue could be the scrollbar.
If it's fast with the scrollbar disabled, the browse/scrolling logic
may not be as optimized as it could be. Scrollbars should always use
ADSGetRelKeyPos() and ADSSetRelKeyPos() instead of key counting functions.
If filtered data seems slower than expected, check these things:
First, optimization is not on by default, so at the top of the app
call
Set( _SET_OPTIMIZE, .T. )
or its command equivalent. RDDADS will use an AOF whenever
dbSetFilter is called *if it can*.
Second, make sure the filter is one ADS can understand. UDFs are out,
as are references to public or private variables. It's also best to
remove field aliases from the string. ADS cannot reference aliases for other
related tables, so they're superfluous.
You can call
? AdsIsExprValid( cFilter )
to check. If this returns False, neither the Local Server nor the
Remote Server can process it, so optimization will never occur (but
the Harbour RDD will process the filtering locally by eval'ing the
codeblock and testing each record). The only way to speed it up is to
fix the filter so ADS understands it.
You can also use dbOrderInfo(DBOI_OPTLEVEL) to see if the current
filter is optimized or not. COMIX users can use:
FUNCTION rlOptLevel()
RETURN dbOrderInfo(DBOI_OPTLEVEL)
This returns the Clipper/COMIX values (not ADS-defined values) because
this is an RDD call, not just a wrapper to the ADS call, which uses different numbers).
Examples:
Status:
Compliance:
Every attempt has been made to make the RDD compliant with the
standard dbfcdx RDD at the .prg level.
One important difference is the handling of structural indexes.
ACE will always automatically open an index with the same
name as the data file. There is no way to turn this feature off.
You can use the Set() function call as well as the equivalent
commands for SET DEFAULT TO, DATEFORMAT, DELETE, and EPOCH.
Harbour automatically makes the call to ADS to change its internal
setting to match Harbour's.
INDEXING and Progress Displays:
ace32.dll does not support the EVAL/EVERY clauses. Remember, there
is an external process doing the indexing that knows nothing of
Harbour expressions or codeblocks. Even with Local Server it's the
DLLs doing all the indexing. So to do progress meters
you need to implement adsRegCallback( bEval ).
It lets you set a codeblock that is eval'ed every 2 seconds.
A numeric value of the "percent completed" is passed to the
codeblock by the ADS server.
PROCEDURE Main()
...
AdsRegCallBack( {| nPercent | outputstuff( nPercent ) } )
/* The above codeblock will be called approximately
every 2 seconds while indexing.
The codeblock can return .T. to abort. */
INDEX ON First+LAST+LABEL1+LABEL2 TAG First
AdsClrCallBack()
RETURN
FUNCTION outputstuff( nPercent ) /* The "callback" function */
? "output stuff", nPercent
RETURN Inkey() == 27
/* If press ESC, returns .T. to abort. */
For programmers who are already familiar with the ACE engine,
Harbour's compatibility with dbfcdx means there are some differences
between the RDDADS in Harbour and the parallel ACE documentation:
1) In ACE, skipping backwards to BOF goes to the phantom record and
sets the record number to 0. In RDDADS, the record pointer stays at
the Top record and only the BOF flag is set to True.
2) In RDDADS, a filter expression can be used that may not be
valid on the server (because of references to public variables or
User-Defined Functions).
In these cases, all data will come back from the server
but will be filtered by the application running on the client.
These situations lose the benefits of having a data server and should
be avoided, but they will function as they would in a Clipper program.
One problem with this scenario is that index key counting
functions that are supposed to give an accurate count respecting
the filter (e.g. dbOrderInfo(DBOI_KEYCOUNT) will return the values the
Server knows about, so the counts may be inaccurate.
3) When setting a relation, the expression must be one that can be
evaluated by the Advantage Expression Engine. UDFs will fail.
Files:
See also:
ADSBlob2File()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Write a Binary (memo) field's contents to a file
Syntax:
ADSBlob2File(cFileName, cFieldName) --> lSuccess
Arguments:
File to create. If it already exists, it will be
overwritten on success and destroyed on error.
Field in the current workarea that contains binary data.
Returns:
True if the file is successfully written.
Description:
See ace.hlp for full details about the Advantage Database Server.
ADSBlob2File() is a wrapper for AdsBinaryToFile.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSFile2Blob()
ADSCACHEOPENCURSORS()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Provides caching of open cursors
Syntax:
ADSCACHEOPENCURSORS() -> nRetVal
Arguments:
Number of cursors to cache.
Returns:
???
Description:
AdsCacheOpenCursors allows cursor closes to be cached in
order for subsequent SELECTS to occur faster. A call to
AdsCloseTable with the cursor cache greater than zero results
in the cursor appearing closed to an application, but still
open on the Advantage server.
AdsCacheOpenCursors is a global setting that affects the
behavior of the entire application. The default number of
open cursors that are cached is 25.
Examples:
AdsCacheOpenCursors( 0 )
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsCacheOpenTables()
ADSCACHEOPENTABLES()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Provides caching of open tables
Syntax:
ADSCACHEOPENTABLES() -> nRetVal
Arguments:
Number of tables to cache.
Returns:
???
Description:
AdsCacheOpenTables allows table closes to be cached in order for
subsequent opens to occur faster. A call to AdsCloseTable with
the table cache greater than zero results in the table appearing
closed to an application, but still open on the Advantage server.
AdsCacheOpenTables is a global setting that affects the behavior
of the entire application. The default number of open tables that
are cached is 0.
Examples:
AdsCacheOpenTables( 25 )
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsCacheOpenCursors()
ADSClearAOF()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Clears an Advantage Optimized Filter in the current workarea.
Syntax:
ADSClearAOF()
Arguments:
None
Returns:
NIL
Description:
See ace.hlp for full details about the Advantage Database Server.
A connection handle retrieved via AdsConnect()
or AdsConnect60(). If omitted, the RDD's current connection
handle is used, but this only exists if AdsConnect() or AdsConnect60()
were previously called.
Returns:
???
Description:
AdsCloseCachedTables can be used to close all cached tables
on a given connection. All cached closed tables on the client
will be closed, as well as all cache closed tables on the server
that might have been used when executing SQL statements.
Examples:
AdsCloseCachedTables()
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsCacheOpenTables(), AdsCacheOpenCursors()
AdsClrCallBack()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Clears the callback set by AdsRegCallBack().
Syntax:
AdsClrCallBack() --> nil
Arguments:
Returns:
Description:
See AdsRegCallBack().
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsRegCallBack()
ADSCONNECT60()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Connect to a local/remote/internet server
Syntax:
ADSCONNECT60(, , [], [], []) -> lSuccess
Arguments:
Name of data dictionary to connect to.
The server type to connect (LOCAL, REMOTE, AIS or all together)
Optional Name of the user connecting to the server
Optional password for the user Name
The optional connection options
Returns:
True if connected, otherwise False.
Description:
Adsconnect60() makes the connection to an advantage database server.
See ace.hlp for full details about the Advantage Database Server.
Examples:
IF adsConnect60( "harbour.add", 7/* All types of connection*/, "ADSSYS", "",)
// Add one user
AdsDDCreateUser(, "Luiz", "papael", "This is luiz User")
ENDIF
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSDDADDTABLE()
ADSCustomizeAOF()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Add or remove records from an existing AOF
Syntax:
ADSCustomizeAOF( [] [, ] ) --> nSuccess
Arguments:
Can be either a single record number or an array of
record numbers to add or delete from the AOF. If omitted, defaults to
the current record.
The type of operation:
ADS_AOF_ADD_RECORD Add the record to the AOF (set the bit). This is the default operation.
ADS_AOF_REMOVE_RECORD Remove the record from the AOF (clear the bit).
ADS_AOF_TOGGLE_RECORD Switch the record into or out of the AOF.
Returns:
ADS error code, or 0 for success.
Description:
An Advantage Optimized Filter (AOF) consists of a bitmap of the records in
the database. If bit 5 is on, record 5 is considered a visible record.
If bit 5 is off, record 5 is not visible. It does not "pass the test".
Initially, the bits are set by the Server according to a filter expression
from SET FILTER TO or adsSetAOF(). But by using ADSCustomizeAOF() you can
add or remove records at will from the visible set. This is useful for
tagging records or for refining a result set after the data has been retrieved
from the server.
The maximum number of records that can be customized in a single call is
16,383, so must not be longer than this.
Calls to AdsCustomizeAOF must be made after an application has created a
filter with a call to AdsSetAOF. To create a completely empty record set
(to which records can be added with calls to AdsCustomizeAOF), use ".F." as
the filter expression given to AdsSetAOF. To create a completely full
record set (from which records can be removed), use ".T." as the filter
expression.
WARNING: Always start with a FULLY optimized AOF!
If an application must use a filter expression that is not fully optimized
as the starting point for customization, the ADS_RESOLVE_IMMEDIATE option
should be used with the call to AdsSetAOF. Otherwise, the dynamic filter
resolution that occurs on the server will automatically remove records that
have been added through the AdsCustomizeAOF calls. The
filter expressions ".T." and ".F." both result in fully optimized AOFs
regardless of available indexes.
See ace.hlp for full details about the Advantage Database Server.
Name of the table inside the data dictionary
Name of the adt or dbf file name
Optional name of the index file
Returns:
-> .T. if file was added, otherwise .F.
Description:
See ace.hlp for full details about the Advantage Database Server.
AdsDDAddTable() adds a new table to an ADS data dictionary.
To add the table you must be connected as ADSSYS user using the AdsConnect60() function
Examples:
IF adsConnect60( "harbour.add", 7/* All types of connection*/, "ADSSYS", "",)
// Add one user
AdsDDCreateUser(,"Luiz", "papael", "This is luiz User")
// Add the tables
AdsDDaddTable("Table1", "table1.adt", "table1.adi")
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSCONNECT60(),ADSUSEDICTIONARY()
ADSEvalAOF()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Evaluate a filter expression to determine its optimization level
Syntax:
ADSEvalAOF() --> nOptimizationLevel
Arguments:
Expression to test.
Returns:
Values are defined in ads.ch:
ADS_OPTIMIZED_FULL, ADS_OPTIMIZED_PART, ADS_OPTIMIZED_NONE.
IMPORTANT NOTE: These values are NOT the same as those returned
by dbOrderInfo().
Description:
See ace.hlp for full details about the Advantage Database Server.
File to read. Can be in UNC format. A common example is an image file.
Field in the current workarea to contain the binary data.
Either ADS_BINARY (the default) or ADS_IMAGE.
This parameter is for fields in DBF files.
ADT tables cannot store binary and image data in standard character
memo fields (they have specific field types for that).
Returns:
True if the file is successfully written.
Description:
See ace.hlp for full details about the Advantage Database Server.
ADSFile2Blob() is a wrapper for AdsFileToBinary.
Use of this function is illegal in an ADS transaction.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSBlob2File()
ADSGetAOF()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Retrieve the filter expression used in the call to AdsSetAOF
Syntax:
ADSGetAOF() --> cFilter
Arguments:
None
Returns:
The filter expression used in the call to AdsSetAOF.
Description:
See ace.hlp for full details about the Advantage Database Server.
Returns the type of Server used by the given connection handle.
Syntax:
AdsGetConnectionType( [] ) --> nConnectionType
Arguments:
A connection handle retrieved via AdsConnect()
or AdsConnect60(). If omitted, the RDD's current connection
handle is used, but this only exists if AdsConnect() or AdsConnect60()
were previously called.
Returns:
The type of Advantage Server that the connection uses, either
ADS_REMOTE_SERVER, ADS_AIS_SERVER, or ADS_LOCAL_SERVER.
Description:
Advantage uses Handles to control connections to various servers.
It's possible that an app may open some files via the Remote server,
but others via the Local server or an Internect connection.
This function identifies the type of server used by a connection handle.
Note that after a table is opened, the type of connection used for
that workarea can be retrieved with AdsGetTableConType().
See ace.hlp for full details.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsGetTableConType(),AdsConnect(),AdsConnect60()
AdsGetLastError()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Returns any error code generated by the most recent ADS API call
Syntax:
AdsGetLastError() --> nErrorCode
Arguments:
None.
Returns:
The error code generated by the most recent ADS API call. Zero for success.
Description:
See ace.hlp for full details about the Advantage Database Server.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSGetRelKeyPos()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Estimated key position of current record within the current index
Syntax:
ADSGetRelKeyPos() --> nKeyPos
Arguments:
None. Only accesses the current index, if any.
Returns:
A value between 0.0 and 1.0, inclusive.
Description:
This function estimates the relative key position within the current index,
respecting any scope setting.
It also works with no active index to yield the relative position of the
current record number.
The value returned is between 0.0 and 1.0, inclusive.
This is the recommended function for positioning a scrollbar
or other "coarse" position interface.
See ace.hlp for full details about the Advantage Database Server.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSKeyNo(),ADSKeyCount(),ADSSetRelKeyPos()
AdsGetTableConType()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Returns the type of Server used by current workarea.
Syntax:
AdsGetTableConType() --> nConnectionType
Arguments:
None.
Returns:
The type of Advantage Server that the current workarea uses, either
ADS_REMOTE_SERVER, ADS_AIS_SERVER, or ADS_LOCAL_SERVER.
Returns zero if the current workarea does not have an Advantage table opened.
Description:
Advantage uses Handles to control connections to various servers.
It's possible that an app may open some files via the Remote server,
but others via the Local server or an Internect connection.
This function identifies the type of server used in the current workarea.
Determine if the ADS server can parse an expression
Syntax:
AdsIsExprValid( ) --> lSuccess
Arguments:
Any hopefully valid expression; often a filter string
Returns:
.T. if the expression is understood by ADS.
Description:
ADS has its own limitations for the logical or string expressions
used in indexes, filters, scopes, etc. Unlike internal RDDs like DBFNTX,
the server is independent of the applications code, so it cannot understand
references to PUBLIC variables or User-Defined Functions (UDFs).
(See ace.hlp under Advantage Expression Engine for a list of functions
allowed by ADS.)
Call AdsIsExprValid() to determine if the server can process the expression.
For illustration, consider filter expressions.
Since Harbour attempts to be as compatible with Clipper as possible,
you CAN set a filter that ADS DOES NOT understand, but the filtering
will be done by the RDD layer itself and ADS will be unaware of the
filter setting. This means more data will be sent "across the wire" from
the server to the client, and the client (in RDDADS) will be doing the
processing. Since the value of a database server is to have more processing
done by the server itself to reduce network traffic, it is better to only use
filter expressions ADS can understand.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsIsIndexed()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Fast determination for if current workarea has a selected index
Syntax:
AdsIsIndexed() --> lActiveIndex
Arguments:
Returns:
Description:
Equivalent to empty(ordSetFocus())<\b>, but faster.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
See also:
ADSIsRecordInAOF()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Determine if a record is in the current AOF
Syntax:
ADSIsRecordInAOF( [] ) --> lSatisfiesFilter
Arguments:
Record number to test. Default is current record.
Returns:
True if the record satisfies the filter criteria.
Description:
See ace.hlp for full details about the Advantage Database Server.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSClearAOF(),ADSRefreshAOF()
ADSKeyCount()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Retrieve the number of keys in a specified index
Syntax:
ADSKeyCount([], , []) --> nKeyCount
Arguments:
Numeric order number OR index tag name. Default is current index.
This parameter is not processed. In other Harbour RDDs,
the second parameter to "ordKeyCount" takes a second argument to identify
a particular Index File in cases where two files are open that contain
orders with the same name. The ADS driver does not support this and
will select the first order with the requested name. To stay consistent
with other RDDs, therefore, the second parameter is reserved and the
is passed as a third parameter.
Indicates if filters and/or scopes are to be respected if set.
Options are defined in ads.ch:
ADS_RESPECTFILTERS Respect filters and scopes
ADS_IGNOREFILTERS Ignore filters and scopes
ADS_RESPECTSCOPES Respect scopes only
Returns:
The number of keys within the current index.
Description:
See ace.hlp for full details about the Advantage Database Server.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSKeyNo(),ADSGetRelKeyPos()
ADSKeyNo()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Get the logical key number of the current record in the given index
Syntax:
ADSKeyNo([], , []) --> nKeyNo
Arguments:
Numeric order number OR index tag name. Default is current index.
This parameter is not processed. In other Harbour RDDs,
the second parameter to "ordKeyNo" takes a second argument to identify
a particular Index File in cases where two files are open that contain
orders with the same name. The ADS driver does not support this and
will select the first order with the requested name. To stay consistent
with other RDDs, therefore, the second parameter is reserved and the
is passed as a third parameter.
Indicates if filters and/or scopes are to be respected if set.
Options are defined in ads.ch:
ADS_RESPECTFILTERS Respect filters and scopes
ADS_IGNOREFILTERS Ignore filters and scopes
ADS_RESPECTSCOPES Respect scopes only
Returns:
The logical key number of the current record in the given index.
Description:
See ace.hlp for full details about the Advantage Database Server.
Wrapper for AdsGetKeyNum.
This function may be slow on a large database with
ADS_RESPECTFILTERS set because it walks through the keys to get the
current position. Compare to ADSGetRelKeyPos().
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSKeyCount(),ADSGetRelKeyPos()
ADSLocking()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Turns on/off the Advantage proprietary locking mode
Syntax:
ADSLocking( ) --> lPriorSetting
Arguments:
.T. to use the Advantage proprietary locking mode
(this is the default setting if a remote server is used)
or pass .F. to use "compatibility" locking.
Returns:
.T. if prior setting was for the proprietary mode.
Description:
See ace.hlp for full details about the Advantage Database Server.
The Advantage Database Server has a fast Proprietary locking mode that
is more efficient than traditional network locking. It is only available
when using the remote server (not the local server).
If a file is opened in the proprietary mode, other applications cannot
open it in a "write" mode. So if non-Advantage applications need
concurrent access to the data files, use the Compatibility locking mode
by calling ADSLocking( .F. ).
ADSLocking() is a Get/Set function for the locking mode. It affects
files at the time they are opened. So when a data
file is opened, the current setting is used for that file until it is
closed. Different files can have different locking modes by changing
the setting before opening a second file.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSRightsCheck()
ADSRefreshAOF()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Update the filter snapshot
Syntax:
ADSRefreshAOF()
Arguments:
None
Returns:
NIL
Description:
See ace.hlp for full details about the Advantage Database Server.
If record updates occur after an AOF is set, the updated records may
or may not be valid records for the filter. ADSRefreshAOF()
re-evaluates the data to include or exclude changed records.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSClearAOF(),ADSIsRecordInAOF(),ADSSetAOF()
AdsRegCallBack()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
For Progress displays: Sets a codeblock to be called during indexing
Syntax:
AdsRegCallBack( bEval ) --> nil
Arguments:
The codeblock that is eval'ed every 2 seconds during
indexing. A numeric value of the "percent completed" is passed
to the codeblock by the ADS server. The codeblock should return
a logical value: .T. to abort or .F. to not stop indexing.
Returns:
Description:
See ace.hlp for full details on AdsRegisterProgressCallback.
ace32.dll does not support the EVAL/EVERY clauses. Remember, there
is an external process doing the indexing that knows nothing of
Harbour expressions or codeblocks. Even with Local Server it's the
DLLs doing all the indexing. So to do progress meters
you need to implement this.
Examples:
PROCEDURE Main()
...
AdsRegCallBack( {| nPercent | outputstuff( nPercent ) } )
/* The above codeblock will be called approximately
every 2 seconds while indexing.
The codeblock can return .T. to abort. */
INDEX ON First+LAST+LABEL1+LABEL2 TAG First
AdsClrCallBack()
RETURN
FUNCTION outputstuff( nPercent ) /* The "callback" function */
? "output stuff", nPercent
RETURN Inkey() == 27
/* If press ESC, returns .T. to abort. */
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsClrCallBack()
ADSRightsCheck()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Sets the "rights checking" setting for opening files
Syntax:
ADSRightsCheck( ) --> lPriorSetting
Arguments:
.T. to check rights upon opening data files (the default),
or .F. to ignore rights
Returns:
Description:
See ace.hlp for full details about the Advantage Database Server.
ADSRightsCheck() is a Get/Set function for the "rights checking" mode.
If the setting is .T. when a file is opened, then the Advantage
Database Server will use the rights of the connected user when
opening the file. If the user does not have rights to the
directory or server, then the open call will fail.
If the setting is .F., then the ADS will
ignore the connected user's rights and open the file
regardless. This lets you allow only
Advantage-based applications to access specific data.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSLocking()
ADSSetAOF()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Create an Advantage Optimized Filter
Syntax:
ADSSetAOF( [, ] ) --> lSuccess
Arguments:
Filter expression to set.
Option to indicate how the filter should be resolved
in the event that the expression cannot be fully optimized.
Options are defined in ads.ch:
ADS_RESOLVE_IMMEDIATE, ADS_RESOLVE_DYNAMIC.
Returns:
True if AOF is created.
Description:
See ace.hlp for full details about the Advantage Database Server.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSClearAOF(),ADSIsRecordInAOF(),ADSRefreshAOF()
ADSSetCharType()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Sets the type of character data expected when opening tables.
Syntax:
ADSSetCharType( , [lOEM] ) --> nPriorSetting
Arguments:
Type of character data in the table.
From ADS docs:
Options are ADS_ANSI and ADS_OEM. This indicates the type of
character data to be stored in the table. For compatibility with
DOS-based CA-Cl*pper applications, ADS_OEM should be specified.
When usTableType is ADS_ADT, this parameter is ignored and ANSI
is always used.
This parameter used for console mode applications, when
character data stored in OEM charset. If lOEM is passed as .T.,
rddads doesn't convert character data into ANSI charset.
Returns:
Description:
See ace.hlp for full details about the Advantage Database Server.
This sets the usCharType parameter used when ADS opens a table.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsRightsCheck(),AdsLocking(), ADSSetFileType()
ADSSetDefault() *
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Get/Set function for ADS's DEFAULT setting.
Syntax:
ADSSetDefault( [] ) --> cPriorSetting
Arguments:
Sets new value if passed.
Returns:
Description:
This function is NOT recommended! It allows direct access to the
ADS internal equivalent to SET DEFAULT TO. But this setting is
automatically maintained by Harbour's Set() function and the
SET DEFAULT TO command, so normal programming will not use this.
It exists primarily for testing purposes.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSSetDeleted() *
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Get/Set function for ADS's ShowDeleted() setting.
Syntax:
ADSSetDeleted( [] ) --> lPriorSetting
Arguments:
Sets new value if passed. The value is parallel
to Harbour usage, so pass .F. to see deleted records or .T.
to hide them. (This is inverted from ADS's AdsShowDeleted()
syntax.)
Returns:
Description:
This function is NOT recommended! It allows direct access to the
ADS internal equivalent to SET DELETED. But this setting is
automatically maintained by Harbour's Set() function and the
SET DELETED ON/OFF command, so normal programming will not use this.
It exists primarily for testing purposes.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsSetExact() *
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Get/Set function for ADS's AdsSetExact() setting.
Syntax:
AdsSetExact( [] ) --> lPriorSetting
Arguments:
Sets new value if passed.
Returns:
Description:
This function is NOT recommended! It allows direct access to the
ADS internal equivalent to SET EXACT. But this setting is
automatically maintained by Harbour's Set() function and the
SET EXACT ON/OFF command, so normal programming will not use this.
It exists primarily for testing purposes.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSSetRelKeyPos()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
GoTo the given estimated key position within the current index
Syntax:
ADSSetSelKeyPos( ) --> nError
Arguments:
Relative key position between 0.0 and 1.0, inclusive.
Returns:
The return/error value of the ADS API call.
Description:
This function moves the record pointer to the estimated relative position
within the current index order, respecting any scope setting.
It also works with no active index to go to the relative position of the
current record number.
This is the recommended function for re-positioning in reaction to
a dragged scrollbar thumb or other "coarse" navigation interface.
See ace.hlp for full details about the Advantage Database Server.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSKeyNo(),ADSKeyCount(),ADSGetRelKeyPos()
AdsSetSearchPath() *
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Get/Set function for ADS's AdsSetSearchPath() setting.
Syntax:
AdsSetSearchPath( [] ) --> cPriorSetting
Arguments:
Sets new value if passed.
Returns:
Description:
This function is NOT recommended! It allows direct access to the
ADS AdsSetSearchPath() setting. But this setting is
automatically maintained by Harbour's Set() function and the
SET PATH command, so normal programming will not use this.
It exists primarily for testing purposes.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
AdsTestRecLocks()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
Turn On or Off a "debug mode" for trapping missed record locks.
Syntax:
AdsTestRecLocks( ) --> lPriorSetting
Arguments:
New setting. Default is FALSE.
Returns:
Prior Setting.
Description:
AdsTestRecLocks() is a Get/Set function for a "record lock checking" mode.
ADS has Implicit Record locking that can mask programming errors.
Implicit locking can occur the first time a value is written to a
field with no lock in effect. The lock can potentially remain in
effect indefinitely if the record pointer is not moved, causing
bugs later in program execution that are hard to find.
In Harbour internal RDDs, a runtime error occurs if an attempt is made
to write to a shared file without a proper lock.
AdsTestRecLocks( .T. ) will turn on a debugging mode to mimic this behavior
and throw an error instead of allowing an implicit lock. Each time a field
is set, we see if the file is open exclusively or locked, and whether
the record has been explicitly locked already. If not, we throw
an error so the developer can catch the missing lock condition.
For performance reasons, Release code should leave this OFF.
Although the call to AdsIsRecordLocked is documented as a client
call, not a server request, and should be fast, it will be
called for EACH FIELD as it is assigned a value.
See ace.hlp for full details about the Advantage Database Server.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
ADSUSEDICTIONARY()*
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
This function has been REMOVED. It specified usage of a datadictionary connection
Syntax:
None
Arguments:
None
Returns:
None
Description:
This function no longer exists. See the Data Dictionary topic
Examples:
Status:
R
Compliance:
Harbour extension
Files:
See also:
ADSCONNECT60()
AEVAL()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Evaluates the subscript element of an array
Syntax:
AEVAL(, , [], []) --> aArray
Arguments:
Is the array to be evaluated.
Is a code block to evaluate for each element processed.
The beginning array element index to evaluate.
The number of elements to process.
Returns:
an array pointer reference.
Description:
This function will evaluate and process the subscript elements
in . A code block passed as defines the operation
to be executed on each element of the array. All elements in
will be evaluated unless specified by a beginning subscript position
in for elements.
Two parameters are passed to the code block . The individual
elements in an array are the first parameter and the subscript position
is the second.
AEVAL() does not replace a FOR...NEXT loop for processing arrays. If
an array is an autonomous unit, AEVAL() is appropriate. If the array
is to be altered or if elements are to be reevaluated, a FOR...NEXT
loop is more appropriate.
Examples:
Status:
R
Compliance:
C
Files:
Library is vm
See also:
EVAL(),DBEVAL()
AFIELDS()*
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Fills referenced arrays with database field information
Syntax:
AFields([,][,][,]) -->
Arguments:
Array of field names
Array of field names
Array of field names
Array of field names
Returns:
Number od fields in a database or work area
Description:
This function will fill a series of arrays with field
names, field types, field lenghts, and number of field
decimal positions for the currently selected or designed
database. Each array parallels the different descriptors
of a file's structure. The first array will consist of the
names of the fields in the current work area. All other arrays
are optional and will be filled with the corrensponding data.
This function will return zero if no parameters are specified
or if no database is avaliable in the current work area. Otherwise,
the number of fields or the lenght of the shortest array argument,
witchever is smaller, will be returned.
AFIELDS() is a compatibility function, it is superseded by
DBSTRUCT() which returns one multidimensional array.
NOTE: The destination arrays must be initialized to a given size,
usually FCOUNT(), before calling this function.
Examples:
PROCEDURE Main()
LOCAL aNames, aTypes, aLens, aDecs, nCount, nFields, i
USE Test
nCount := FCount()
? "Number of fields:", nCount
PrintFields( nCount ) // Information for all fields
PrintFields( 4 ) // Information for first 4 fields
RETURN
PROCEDURE PrintFields( nCount )
LOCAL aNames, aTypes, aLens, aDecs, nFields, i
aNames := Array( nCount )
aTypes := Array( nCount )
aLens := Array( nCount )
aDecs := Array( nCount )
nFields := aFields( aNames, aTypes, aLens, aDecs )
? "Number of items :", nFields
FOR i := 1 TO nFields
? i, PadR( aNames[ i ], 12 ), aTypes[ i ]
?? aLens[ i ], aDecs[ i ]
NEXT
?
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBSTRUCT()
AFILL()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Fill an array with a specified value
Syntax:
AFILL( , , [], [] ) --> aTarget
Arguments:
Name of array to be filled.
Expression to be globally filled in Subscript starting position
Number of subscript to be filled
Returns:
an array pointer.
Description:
This function will fill each element of an array named with
the value . If specified, denotes the beginning
element to be filled and the array elements will continue to be
filled for positions. If Not specified, the value of
will be 1, and the value of will be the value
of LEN(); thus, all subscript positions in the array
will be filled with the value of .
This function will work on only a single dimension of .
If there are array pointer references within a subscript ,
those values will be lost, since this function will overwrite those
values with new values.
Examples:
LOCAL aTest := { NIL, 0, 1, 2 }
AFill( aTest, 5 )
Status:
R
Compliance:
C
Files:
Library is vm
See also:
AADD(),AEVAL(),DBSTRUCT(),DIRECTORY()
AFTERATNUM()
Lang:
atnum.txt
Component:
hbct
Doc. source:
hbct\doc\en\atnum.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Returns string portion after nth occurence of substring
Syntax:
AFTERATNUM (, , [],
[] ) --> cRestString
Arguments:
is the substring scanned for
is the scanned string
[] determines how many occurences are of
in are searched
Default: search last occurence
[] determines how many character from the start
should be ignored in the search
Default: 0
Returns:
the portion of after the th
occurence of in
If such a rest does not exist, an empty string
is returned.
Description:
This function scans for . After the
th match (or the last one, depending on the value of
) has been found, the portion of
after that match will be returned. If there aren't enough
matches or the last match is identical to the end of , an
empty string will be returned.
After a match has been found, the function continues to scan after
that match if the CSETATMUPA() switch is turned off, with the
second character of the matched substring otherwise.
The function will also consider the settings of SETATLIKE().
Examples:
? AFTERATNUM ("!", "What is the answer ? 4 ! 5 !") -> ""
? AFTERATNUM ("!", "What is the answer ? 4 ! 5 ?") -> " 5 ?"
Status:
Ready
Compliance:
AFTERATNUM() is compatible with CT3's AFTERATNUM().
Files:
Source is atnum.c, library is libct.
See also:
ATNUM(),BEFORATNUM(),CSETATMUPA(),SETATLIKE()
AINS()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Insert a NIL value at an array subscript position.
Syntax:
AINS( , ) --> aTarget
Arguments:
Array name.
Subscript position in
Returns:
an array pointer reference.
Description:
This function inserts a NIL value in the array named
at the th position.
All array elements starting with the th position will be
shifted down one subscript position in the array list and the
last item in the array will be removed completely. In other words,
if an array element were to be inserted at the fifth subscript
position, the element previously in the fifth position would now
be located at the sixth position. The length of the array
will remain unchanged.
C Prototype (macro definition)
#include "extend.api"
ALENGTH( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is extend.api
See also:
ALERT()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Display a dialog box with a message
Syntax:
ALERT( , [], [], [] ) --> nChoice or NIL
Arguments:
Message to display in the dialog box. can be
of any Harbour type.
If is an array of Character strings, each element would
be displayed in a new line. If is a Character
string, you could split the message to several lines by placing
a semicolon (;) in the desired places.
Array with available response. Each element should be
Character string. If omitted, default is { "Ok" }.
Color string to paint the dialog box with.
If omitted, default color is "W+/R".
Number of seconds to wait to user response before abort.
Default value is 0, that wait forever.
Returns:
ALERT() return Numeric value representing option number chosen.
If ESC was pressed, return value is zero.
The return value is NIL
if ALERT() is called with no parameters, or if type is
not Character and HB_CLP_STRICT option was used. If seconds
had passed without user response, the return value is 1.
Description:
ALERT() display simple dialog box on screen and let the user select
one option. The user can move the highlight bar using arrow keys or
TAB key. To select an option the user can press ENTER, SPACE or the
first letter of the option.
If the program is executed with the //NOALERT command line switch,
nothing is displayed and it simply returns NIL. This switch could
be overridden with __NONOALERT().
If the GT system is linked in, ALERT() display the message using
the full screen I/O system, if not, the information is printed to
the standard output using OUTSTD().
Examples:
LOCAL cMessage, aOptions, nChoice
// harmless message
cMessage := "Major Database Corruption Detected!;" + ;
"(deadline in few hours);;" + ;
"where DO you want to go today?"
// define response option
aOptions := { "Ok", "www.jobs.com", "Oops" }
// show message and let end user select panic level
nChoice := ALERT( cMessage, aOptions )
DO CASE
CASE nChoice == 0
// do nothing, blame it on some one else
CASE nChoice == 1
? "Please call home and tell them you're gonn'a be late"
CASE nChoice == 2
// make sure your resume is up to date
CASE nChoice == 3
? "Oops mode is not working in this version"
ENDCASE
Status:
R
Compliance:
This function is sensitive to HB_CLP_STRICT settings during the
compilation of src/rtl/alert.prg
defined: accept Character values only and return
NIL if other types are passed.
undefined: could be any type, and internally
converted to Character string. If type is Array, multi-line message
is displayed.
defined: Only the first four valid are taken.
undefined: could contain as many as needed options.
If HB_COMPAT_C53 was define during compilation of
src/rtl/alert.prg the Left-Mouse button could be used to select
an option.
The interpretation of the //NOALERT command line switch is done only
if HB_CLP_UNDOC was define during compilation of src/rtl/alert.prg
is a Harbour extension, or at least un-documented
in Clipper 5.2 NG.
is a Harbour extension.
Files:
Library is rtl
See also:
@...PROMPT,MENU TO,OUTSTD(),__NONOALERT()
ALIAS()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Returns the alias name of a work area
Syntax:
Alias([]) -->
Arguments:
Number of a work area
Returns:
Name of alias
Description:
This function returns the alias of the work area indicated by
If is not provided, the alias of the current work area is
returned.
Examples:
PROCEDURE Main()
USE Test
SELECT 0
QOut( iif( Alias() == "", "No Name", Alias() ) )
Test->( QOut( Alias() ) )
QOut( Alias( 1 ) )
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBF()
ALLTRIM()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Removes leading and trailing blank spaces from a string
Syntax:
ALLTRIM( ) --> cExpression
Arguments:
Any character string
Returns:
An string will all blank spaces removed from
Description:
This function returns the string will all leading and
trailing blank spaces removed.
This function returns an array with all the months names in the
selected current language.
Examples:
aMonths := AMonths()
? aMonths[1] -> January
? aMonths[1] -> Enero (if the selected language is Spanish)
Status:
R
Compliance:
This function is new in Harbour.
Files:
Library is libmisc
See also:
ADAYS()
ARRAY()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Create an uninitialized array of specified length
Syntax:
ARRAY( [, ...] ) --> aArray
Arguments:
is the number of elements in the specified dimension.
Returns:
an array of specified dimensions.
Description:
This function returns an uninitialized array with the length of
.
Nested arrays are uninitialized within the same array
pointer reference if additional parameters are specified.
Establishing a memory variable with the same name as the array may
destroy the original array and release the entire contents of the
array. This depends, of course, on the data storage type of either
the array or the variable with the same name as the array.
Examples:
PROCEDURE Main()
LOCAL aArray := Array( 10 )
LOCAL x
FOR x := 1 TO Len( aArray )
aArray[ x ] := Array( x )
NEXT
// Result is: { { NIL }, { NIL, NIL }, ... }
RETURN
Status:
R
Compliance:
C(array)
Files:
Library is vm
See also:
AADD(),ADEL(),AFILL(),AINS()
ASC()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Returns the ASCII value of a character
Syntax:
ASC( ) --> nAscNumber
Arguments:
Any character expression
Returns:
ASCII value
Description:
This function return the ASCII value of the leftmost character of
any character expression passed as .
Examples:
? ASC( "A" )
? ASC( "¹" )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
CHR()
ASCAN()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Scan array elements for a specified condition
Syntax:
ASCAN( , , [], [] ) --> nStoppedAt
Arguments:
Array to be scanned.
Expression to search for in Beginning subscript position at which to start the search.
Number of elements to scan with .
Returns:
A numeric value of subscript position where
was found, or 0 if is not found.
Description:
This function scan the content of array named for the
value of . The return value is the position in the array
in which was found. If it was not found, the
return value will be 0.
If specified, the beginning subscript position at which to start
scanning may be set with the value passed as . The default
is 1.
If specified, the number of array elements to scan may be set with
the value passed as . The default is the number of elements
in the array .
If is a code block, the operation of the function is
slightly different. Each array subscript pointer reference is
passed to the code block to be evaluated. The scanning routine
will continue until the value obtained from the code block is a
logical true (.T.) or until the end of the array has been reached.
Examples:
LOCAL aDir := Directory( "*.prg" )
AScan( aDir,,, {| x, y | x[ 1 ] := "test.prg" } )
Status:
R
Compliance:
This function is not CA-Cl*pper compatible. CA-Cl*pper ASCAN() is affected by the SET EXACT ON/OFF Condition
Files:
Library is vm
See also:
AEVAL()
ASCIISUM()
Lang:
asciisum.txt
Component:
hbct
Doc. source:
hbct\doc\en\asciisum.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
calculate the sum of the ASCII values of the characters in a string
Syntax:
ASCIISUM () --> nAsciiSum
Arguments:
the string to be processed
Returns:
sum of the ASCII values in
Description:
The ASCIISUM() function sums up the ASCII values of the characters
in . Be aware that the function is not position sensitive,
i.e. a change of position of a certain character in the string does
not change the ascii sum.
The function ASIN() is the inverse function of SIN(). It takes a
sine value and returns the smallest(!) angle whose sine equals to the argument.
The return value is given in radiants (full angle equals 2*Pi -
see DTOR() if you need to convert it into degress).
Note, that must be between -1 and 1 and that
is always between -PI()/2 and PI()/2.
Name of array to be dynamically altered
Numeric value representing the new size of
Returns:
an array pointer reference to .
Description:
This function will dynamically increase or decrease the size of
by adjusting the length of the array to subscript
positions.
If the length of the array is shortened, those former
subscript positions are lost. If the length of the array is
lengthened a NIL value is assigned to the new subscript position.
Examples:
LOCAL aArray := { 1 } // Result: aArray is { 1 }
ASize( aArray, 3 ) // Result: aArray is { 1, NIL, NIL }
ASize( aArray, 1 ) // Result: aArray is { 1 }
Status:
R
Compliance:
If HB_COMPAT_C53 is defined, the function generates an Error,
else it will return the array itself.
Files:
Library is vm
See also:
AADD(),ADEL(),AFILL(),AINS()
ASORT()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Sort an array
Syntax:
ASORT( , [], [], [] ) --> aArray
Arguments:
Array to be sorted.
The first element to start the sort from, default is 1.
Number of elements starting from to sort, default
is all elements.
Code block for sorting order, default is ascending order
{| x, y | x < y }. The code block should accept two parameters and
must return .T. if the sort is in order, .F. if not.
Returns:
reference to the now sorted or NIL if the
passed is not an array.
Description:
ASORT() sort all or part of a given array. If is omitted,
the function expect to be one dimensional array containing
single data type (one of: Character, Date, Logical, Numeric) and sort
this array in ascending order: Character are sorted by their ASCII
value, Dates are sorted chronologically, Logical put .F. values before
.T., Numeric are sorted by their value.
If is specified, it is used to handle the sorting order. With
each time the block is evaluate, two array elements are passed to the
code block, and must return a logical value that state if
those elements are in order (.T.) or not (.F.). Using this block you
can sort multidimensional array, descending orders or even (but why
would you want to do that) sort array that contain different data
type.
Examples:
// sort numeric values in ascending order
ASort( { 3, 1, 4, 42, 5, 9 } ) // result: { 1, 3, 4, 5, 9, 42 }
// sort character strings in descending lexical order
aKeys := { "Ctrl", "Alt", "Delete" }
bSort := {| x, y | Upper( x ) > Upper( y ) }
ASort( aKeys,,, bSort ) // result: { "Delete", "Ctrl", "Alt" }
// sort two-dimensional array according to 2nd element of each pair
aPair := { { "Sun", 8 }, { "Mon", 1 }, { "Tue", 57 }, { "Wed", -6 } }
ASort( aPair,,, {| x, y | x[ 2 ] < y[ 2 ] } )
// result: { { "Wed", -6 }, { "Mon", 1 }, { "Sun", 8 }, { "Tue", 57 } }
Status:
R
Compliance:
C(arrayblock)
Files:
Library is vm
See also:
ASCAN(),EVAL(),SORT
AT()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Locates the position of a substring in a main string.
Syntax:
AT( , , [], [] ) --> nPos
Arguments:
Substring to search for
Main string
First position to search in cString, by default 1
End position to search, by default cString length
Returns:
AT() return the starting position of the first occurrence of the
substring in the main string
Description:
This function searches the string for the characters in
the first string . If the substring is not contained within
the second expression, the function will return 0. The third and fourth
parameters lets you indicate a starting and end offset to search in.
This function is sensitive to HB_CLP_STRICT settings during the
compilation of src/rtl/at.c
and are Harbour extensions and do not exist if
HB_CLP_STRICT is defined. In that case, the whole string is searched.
Files:
Library is rtl
See also:
RAT()
ATADJUST()
Lang:
atadjust.txt
Component:
hbct
Doc. source:
hbct\doc\en\atadjust.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Adjusts a sequence within a string to a specified position
Syntax:
ATADJUST (, , ,
[], [],
[]) -> cString
Arguments:
is the sequence to be adjusted within is the string that contains specifies the position to that
will be adjusted
[] specifies which occurence of
in is to be adjusted
Default: last occurence
[] specifies how many characters should be omitted
in the scan
[] specifies the character that is used for the
adjustment
Returns:
cString the changed string
Description:
Examples:
Status:
Ready
Compliance:
ATADJUST() works like CT3's ATADJUST()
Files:
Source is atadjust.c, library is ct3.
See also:
SETATLIKE(),CSETATMUPA()
ATAIL()
Lang:
array.txt
Component:
harbour
Doc. source:
.\doc\en\array.txt
Template:
Function
Category:
API
Subcategory:
Array
Oneliner:
Returns the rightmost element of an array
Syntax:
ATAIL( ) --> Element
Arguments:
is the array.
Returns:
the expression of the last element in the array.
Description:
This function return the value of the last element in the array
named . This function does not alter the size of the
array or any of the subscript values.
Examples:
LOCAL aArray := { "Harbour", "is", "Supreme", "Power" }
? ATail( aArray ) // Result is "Power"
Status:
R
Compliance:
C
Files:
Library is vm
See also:
LEN(),ARRAY(),ASIZE(),AADD()
ATAN()
Lang:
trig.txt
Component:
hbct
Doc. source:
hbct\doc\en\trig.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Arcus tangent of the argument
Syntax:
ACOS (nTangent) -> nRadiant
Arguments:
the tangent of an angle
Returns:
the angle whose tangent is
Description:
The function ATAN() is the inverse function of TAN(). It takes a
tangent value and returns the smallest(!) angle whose tangent equals to the argument.
The return value is given in radiants between -PI()/2 and PI()/2
(full angle equals 2*Pi - see DTOR() if you need to convert it into degress).
The function ATN2() is an alternate function for calculating
the arcus tangent, atn2(x,y) = atan(x/y).
It takes two arguments, the sine and the cosine
of the angle that should be calculated. Thus, in contrast to the ATAN()
function, ATN2() can distinguish whether the sine or the cosine has
a negative sign (or both being positive or negative), so that
the return value can be between -PI() and PI() and covers the full
angle.
The return value is given in radiants (full angle equals 2*Pi -
see DTOR() if you need to convert it into degress).
Returns the start position of the nth occurence of a substring in a string
Syntax:
ATNUM (, , [],
[] ) --> nPosition
Arguments:
is the substring scanned for
is the scanned string
[] determines how many occurences are of
in are searched
Default: search last occurence
[] determines how many character from the start
should be ignored in the search
Default: 0
Returns:
the position of the th
occurence of in .
If such an occurence does not exist, 0
is returned.
Description:
This function scans for . After the
th match (or the last one, depending on the value of
) has been found, the position of
that match will be returned. If there aren't enough
matches or there is no last match, 0 will be returned.
After a match has been found, the function continues to scan after
that match if the CSETATMUPA() switch is turned off, with the
second character of the matched substring otherwise.
The function will also consider the settings of SETATLIKE().
Examples:
? ATNUM ("!", "What is the answer ? 4 ! 5 !") -> 28
? ATNUM ("!", "What is the answer ? 4 ! 5 ?") -> 24
Status:
Ready
Compliance:
ATNUM() is compatible with CT3's ATNUM().
Files:
Source is atnum.c, library is libct.
See also:
ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE()
ATREPL()
Lang:
atrepl.txt
Component:
hbct
Doc. source:
hbct\doc\en\atrepl.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Search and replace sequences in a string
Syntax:
ATREPL (, , , [],
[], []) --> cString
Arguments:
is the substring searched for in is the processed string
is the replacement for sequences found
[] specifies the number of replacements
Default: last occurence
[] if set to .T., only the th sequence
of will be replaced, else
all sequences will be replaced.
Default: .F.
[]) specifies how many characters in from
the beginning should be ignored by the function
Default: 0
Returns:
Description:
The ATREPL() function searches and replaces sequences in a string.
First, the function ignores the first characters of .
Then, if is set to .T., it searches for the th
occurence of in . If successful, the
sequence will be replaced with .
If is set to .F., the same search is performed, but EVERY
occurence of till the th (inclusive) will
be replaced with . Note that, in this case,
the replacements are performed even if the th occurence
does not exist.
By using the CSETATMUPA() switch you can decide whether the
function restarts searching after a found sequence of after
the first character of that sequence.
The function allows the use of wildcards in
and looks for the settings of SETATLIKE().
ATREPL() is compatible with CT3's ATREPL().
Note the new, 6th parameter !
Files:
Source is atrepl.c, library is ct3.
See also:
CSETATMUPA() SETATLIKE()
ATTOKEN()
Lang:
token1.txt
Component:
hbct
Doc. source:
hbct\doc\en\token1.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Position of a token in a string
Syntax:
ATTOKEN (, [],
[], []) -> nPosition
Arguments:
is the processed string
[] is a list of characters separating the tokens
in
Default: chr(0)+chr(9)+chr(10)+chr(13)+chr(26)+
chr(32)+chr(32)+chr(138)+chr(141)+
",.;:!\?/\\<>()#&%+-*"
[] specifies the count of the token whose
position should be calculated
Default: last token
[] specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty tokens
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
Returns:
The start position of the specified token or
0 if such a token does not exist in .
Description:
The ATTOKEN() function calculates the start position of tne
th token in . By setting the new
parameter to a value different than 0, you can specify how many tokenizing
characters are combined at most to one token stop. Be aware that
this can result to empty tokens there the start position is not
defined clearly. Then, ATTOKEN() returns the position there the
token WOULD start if its length is larger than 0. To check for
empty tokens, simply look if the character at the returned position
is within the tokenizer list.
Examples:
attoken ("Hello, World!") --> 8 // empty strings after tokenizer
// are not a token !
Status:
Ready
Compliance:
ATTOKEN() is compatible with CT3's ATTOKEN, but has an additional
4th parameter to let you specify a skip width equal to that in the
TOKEN() function.
The specified variable was not found.
If it is a database field ensure that the required database is open.
If it is a private or public variable then it must be first created
using PRIVATE or PUBLIC statement.
Examples:
Status:
Compliance:
C
Files:
See also:
BASE/1068
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of argument
Syntax:
Arguments:
Returns:
Description:
The used data is not of logical type.
Examples:
Status:
Compliance:
C
Files:
See also:
BASE/1068
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Bound error in array access
Syntax:
Arguments:
Returns:
Description:
The attempt to retrieve data from non-array value.
Examples:
Status:
Compliance:
C
Files:
See also:
BASE/1068
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Bound error in array element assignment
Syntax:
Arguments:
Returns:
Description:
The specified index into an array was greater then the number of
elements in the array.
Examples:
Status:
Compliance:
C
Files:
See also:
BASE/1069
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Bound error in array access
Syntax:
Arguments:
Returns:
Description:
The attempt to set data to non-array value.
Examples:
Status:
Compliance:
C
Files:
See also:
BASE/1072
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The type of compared arguments do not match.
Examples:
<>
Status:
Compliance:
C
Files:
See also:
BASE/1073
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The type of compared argument do not match.
Examples:
<
Status:
Compliance:
C
Files:
See also:
BASE/1074
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The type of compared arguments do not match.
Examples:
<=
Status:
Compliance:
C
Files:
See also:
BASE/1075
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The type of compared arguments do not match.
Examples:
>
Status:
Compliance:
C
Files:
See also:
BASE/1076
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The type of compared arguments do not match.
Examples:
>=
Status:
Compliance:
C
Files:
See also:
BASE/1076
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The value of argument cannot be incremented.
Examples:
++
Status:
Compliance:
C
Files:
See also:
BASE/1076
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The arguments of '$' operator are not a strings.
Examples:
Status:
Compliance:
C
Files:
See also:
BASE/1077
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
Operation is not allowed for passed argument. The argument is not
a logical value.
Examples:
!
Status:
Compliance:
C
Files:
See also:
BASE/1078
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The type of compared arguments do not match.
Examples:
==
Status:
Compliance:
C
Files:
See also:
BASE/1078
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The type of one or both arguments is not a logical.
Examples:
.AND.
Status:
Compliance:
C
Files:
See also:
BASE/1079
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The type of one or both arguments is not a logical.
Examples:
.OR.
Status:
Compliance:
C
Files:
See also:
BASE/1081
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The plus operation is not allowed for used arguments.
Examples:
+
Status:
Compliance:
C
Files:
See also:
BASE/1082
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of arguments
Syntax:
Arguments:
Returns:
Description:
The minus operation is not allowed for used arguments.
Examples:
-
Status:
Compliance:
C
Files:
See also:
BASE/1085
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
MOD
Status:
Compliance:
C
Files:
See also:
BASE/1089
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
ABS
Status:
Compliance:
C
Files:
See also:
BASE/1090
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
INT
Status:
Compliance:
C
Files:
See also:
BASE/1092
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
MIN
Status:
Compliance:
C
Files:
See also:
BASE/1093
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
MAX
Status:
Compliance:
C
Files:
See also:
BASE/1094
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
ROUND
Status:
Compliance:
C
Files:
See also:
BASE/1095
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
LOG
Status:
Compliance:
C
Files:
See also:
BASE/1096
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
EXP
Status:
Compliance:
C
Files:
See also:
BASE/1097
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not an numeric
value
Examples:
SQRT
Status:
Compliance:
C
Files:
See also:
BASE/1098
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not a string
value
Examples:
VAL
Status:
Compliance:
C
Files:
See also:
BASE/1099
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is not a numeric
value
Examples:
STR
Status:
Compliance:
C
Files:
See also:
BASE/1100
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:
The specified argument is not a string.
Examples:
RTRIM, TRIM
Status:
Compliance:
C
Files:
See also:
BASE/1101
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:
The specified argument is not a string.
Examples:
LTRIM
Status:
Compliance:
C
Files:
See also:
BASE/1102
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The first argument passed to a function is not a string.
Examples:
UPPER
Status:
Compliance:
C
Files:
See also:
BASE/1103
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The first argument passed to a function is not a string.
Examples:
LOWER
Status:
Compliance:
C
Files:
See also:
BASE/1104
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:
The specified argument is not a numeric value.
Examples:
CHR
Status:
Compliance:
C
Files:
See also:
BASE/1105
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The arguments passed to a function are of incorrect type.
Examples:
SPACE
Status:
Compliance:
C
Files:
See also:
BASE/1106
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The arguments passed to a function are of incorrect type.
Examples:
REPLICATE
Status:
Compliance:
C
Files:
See also:
BASE/1107
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:
The specified argument is not a string.
Examples:
ASC
Status:
Compliance:
C
Files:
See also:
BASE/1108
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:
The specified argument is not a string.
Examples:
AT
Status:
Compliance:
C
Files:
See also:
BASE/1110
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The first argument passed to a function is not a string.
Examples:
SUBSTR
Status:
Compliance:
C
Files:
See also:
BASE/1110
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The passed argument is neither a string nor an array.
Examples:
LEN
Status:
Compliance:
C
Files:
See also:
BASE/1112
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function are of incorrect
type
Examples:
YEAR
Status:
Compliance:
C
Files:
See also:
BASE/1113
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function are of incorrect
type
Examples:
MONTH
Status:
Compliance:
C
Files:
See also:
BASE/1114
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function are of incorrect
type
Examples:
DAY
Status:
Compliance:
C
Files:
See also:
BASE/1115
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function are of incorrect
type
Examples:
DOW
Status:
Compliance:
C
Files:
See also:
BASE/1116
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function are of incorrect
type
Examples:
CMONTH
Status:
Compliance:
C
Files:
See also:
BASE/1117
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is of incorrect
type
Examples:
CDOW
Status:
Compliance:
C
Files:
See also:
BASE/1120
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is of incorrect
type
Examples:
DTOS
Status:
Compliance:
C
Files:
See also:
BASE/1122
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:
The argument (or arguments) passed to a function is of incorrect
type
Examples:
TRANSFORM
Status:
Compliance:
C
Files:
See also:
BASE/1124
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect type of argument
Syntax:
Arguments:
Returns:
Description:
The first argument is not a string.
Examples:
LEFT
Status:
Compliance:
C
Files:
See also:
BASE/1126
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The first arguments passed to a function is not a string.
Examples:
STRTRAN
Status:
Compliance:
C
Files:
See also:
BASE/1132
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Bound error in array access
Syntax:
Arguments:
Returns:
Description:
The specified index into an array was greater then the number of
elements in the array.
Examples:
Status:
Compliance:
C
Files:
See also:
BASE/1133
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Bound error in array assignment
Syntax:
Arguments:
Returns:
Description:
The specified index into an array was greater then the number of
elements in the array.
Examples:
Status:
Compliance:
C
Files:
See also:
BASE/2010
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect arguments type
Syntax:
Arguments:
Returns:
Description:
Passed Run time errors was not strings with filenames to copy/
Examples:
__COPYFILE
Status:
Compliance:
H
Files:
See also:
BASE/2012
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
File error
Syntax:
Arguments:
Returns:
Description:
An error has occurred during the attempt to open, create or write
during copy operation
Examples:
__COPYFILE
Status:
Compliance:
C
Files:
See also:
BASE/2017
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to a function
Syntax:
Arguments:
Returns:
Description:
The first argument is not an array or/and the second argument
is not a code block
Examples:
AEVAL
Status:
Compliance:
C
Files:
See also:
BASE/2020
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The passed value is negative. Only values > 0 are allowed.
Examples:
SET DECIMALS
SET EPOCH
SET MARGIN
SET MESSAGE
Status:
Compliance:
C
Files:
See also:
BASE/3001
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect argument type
Syntax:
Arguments:
Returns:
Description:
The passed argument is not an object. Only data of type OBJECT
can be cloned by this function
Examples:
OCLONE
Status:
Compliance:
H
Files:
See also:
BASE/3002
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Super class does not return an object
Syntax:
Arguments:
Returns:
Description:
Passed argument is not a name of defined class or specified class
doesn't have a super class
Examples:
__INSTSUPER
Status:
Compliance:
H
Files:
See also:
BASE/3003
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Cannot find super class
Syntax:
Arguments:
Returns:
Description:
Passed argument is not a name of defined class
Examples:
__INSTSUPER
Status:
Compliance:
H
Files:
See also:
BASE/3004
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Cannot modify a DATA item in a class
Syntax:
Arguments:
Returns:
Description:
The attempt to modify a data member of a class was made.
Only INLINE and METHOD can be modified
Examples:
CLASSMOD
Status:
Compliance:
H
Files:
See also:
BASE/3005
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect arguments type
Syntax:
Arguments:
Returns:
Description:
Either the first argument was not an object or the second argument
wasn't a string.
Examples:
ISMESSAGE, OSEND
Status:
Compliance:
H
Files:
See also:
BASE/3007
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of argument
Syntax:
Arguments:
Returns:
Description:
The passed arguments are causing conflict in handling of the request.
There is no point in waiting forever for no input events!
Examples:
INKEY
Status:
Compliance:
H
Files:
See also:
BASE/3008
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid type of argument
Syntax:
Arguments:
Returns:
Description:
The passed argument(s) is not a string. It should be a string with
a variable name or an one-dimensional array of strings.
Examples:
__MVPRIVATE, __MVPUBLIC
Status:
Compliance:
H
Files:
See also:
BASE/3009
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect argument passed to __MVGET function
Syntax:
Arguments:
Returns:
Description:
__MVGET function expects only one argument: a string with a name
of variable. The value of this variable will be returned.
Examples:
__MVGET
Status:
Compliance:
H
Files:
See also:
BASE/3010
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Incorrect argument passed to __MVPUT function
Syntax:
Arguments:
Returns:
Description:
__MVPUT function expects at least one argument: a string with a name
of variable. The value of this variable will be set.
Examples:
__MVPUT
Status:
Compliance:
H
Files:
See also:
BASE/3011
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to a function
Syntax:
Arguments:
Returns:
Description:
The attempt to retrieve the function argument that was not passed.
The number of requested argument is greater then the number of
passed arguments.
Examples:
PVALUE
Status:
Compliance:
H
Files:
See also:
BASE/3012
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to a function
Syntax:
Arguments:
Returns:
Description:
The first argument is not a string with function/procedure name
that should be called.
Examples:
DO
Status:
Compliance:
H
Files:
See also:
BASE/3101
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to an object/class function
Syntax:
Arguments:
Returns:
Description:
One passed argument is not of the required type.
Examples:
__OBJ*()
Status:
Compliance:
H
Files:
See also:
BASE/3102
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
A symbol should be modified or deleted from a class, but the symbol
doesn't exist.
Syntax:
Arguments:
Returns:
Description:
A symbol should be modified or deleted from a class, but the symbol
doesn't exist.
Examples:
__OBJ*()
Status:
Compliance:
H
Files:
See also:
BASE/3103
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
A symbol should be added to a class, but the symbol already exists.
Syntax:
Arguments:
Returns:
Description:
A symbol should be added to a class, but the symbol already exists.
Examples:
__OBJ*()
Status:
Compliance:
H
Files:
See also:
BEFORATNUM()
Lang:
atnum.txt
Component:
hbct
Doc. source:
hbct\doc\en\atnum.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Returns string portion before nth occurence of substring
Syntax:
BEFORATNUM (, , [],
[] ) --> cRestString
Arguments:
is the substring scanned for
is the scanned string
[] determines how many occurences are of
in are searched
Default: search last occurence
[] determines how many character from the start
should be ignored in the search
Default: 0
Returns:
the portion of before the th
occurence of in
If such a string does not exist, an empty string
is returned.
Description:
This function scans for . After the
th match (or the last one, depending on the value of
) has been found, the portion of
before that match will be returned. If there aren't enough
matches or the last match is identical to the start of
(i.e. the last match is the first match), an empty string will be returned.
After a match has been found, the function continues to scan after
that match if the CSETATMUPA() switch is turned off, with the
second character of the matched substring otherwise.
The function will also consider the settings of SETATLIKE().
Examples:
? BEFORATNUM ("!", "What is the answer ? 4 ! 5 !") -> "What is the answer ? 4 ! 5 "
? BEFORATNUM ("!", "What is the answer ? 4 ! 5 ?") -> "What is the answer ? 4 "
Status:
Ready
Compliance:
BEFORATNUM() is compatible with CT3's BEFORATNUM().
Files:
Source is atnum.c, library is ct3.
See also:
ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE()
BIN2I()
Lang:
binnum.txt
Component:
harbour
Doc. source:
.\doc\en\binnum.txt
Template:
Function
Category:
API
Subcategory:
Conversion
Oneliner:
Convert signed short encoded bytes into Harbour numeric
Syntax:
BIN2I( ) --> nNumber
Arguments:
is a character string that contain 16 bit encoded signed
short integer (least significant byte first). The first two bytes
are taken into account, the rest if any are ignored.
Returns:
BIN2I() return numeric integer (or 0 if is not a string).
Description:
BIN2I() is one of the low level binary conversion functions, those
functions convert between Harbour numeric and a character
representation of numeric value. BIN2I() take two bytes of encoded
16 bit signed short integer and convert it into standard Harbour
numeric value.
You might ask what is the need for such functions, well, first of
all it allow you to read/write information from/to a binary file
(like extracting information from DBF header), it is also a useful
way to share information from source other than Harbour (C for
instance).
BIN2I() is the opposite of I2BIN()
Convert signed long encoded bytes into Harbour numeric
Syntax:
BIN2L( ) --> nNumber
Arguments:
is a character string that contain 32 bit encoded signed
long integer (least significant byte first). The first four bytes
are taken into account, the rest if any are ignored.
Returns:
BIN2L() return numeric integer (or 0 if is not a string).
Description:
BIN2L() is one of the low level binary conversion functions, those
functions convert between Harbour numeric and a character
representation of numeric value. BIN2L() take four bytes of encoded
32 bit signed long integer and convert it into standard Harbour
numeric value.
You might ask what is the need for such functions, well, first of
all it allow you to read/write information from/to a binary file
(like extracting information from DBF header), it is also a useful
way to share information from source other than Harbour (C for
instance).
BIN2L() is the opposite of L2BIN()
Examples:
// Show number of records in DBF
#include "fileio.ch"
PROCEDURE Main()
LOCAL nHandle, cBuffer := Space( 4 )
nHandle := FOpen( "test.dbf" )
IF nHandle != F_ERROR
FSeek( nHandle, 4 )
FRead( nHandle, @cBuffer, hb_BLen( cBuffer ) )
? "Number of records in file:", Bin2L( cBuffer )
FClose( nHandle )
ELSE
? "Can not open file"
ENDIF
RETURN
Convert unsigned long encoded bytes into Harbour numeric
Syntax:
BIN2U( ) --> nNumber
Arguments:
is a character string that contain 32 bit encoded unsigned
long integer (least significant byte first). The first four bytes
are taken into account, the rest if any are ignored.
Returns:
BIN2U() return numeric integer (or 0 if is not a string).
Description:
BIN2U() is one of the low level binary conversion functions, those
functions convert between Harbour numeric and a character
representation of numeric value. BIN2U() take four bytes of encoded
32 bit unsigned long integer and convert it into standard Harbour
numeric value.
You might ask what is the need for such functions, well, first of
all it allow you to read/write information from/to a binary file
(like extracting information from DBF header), it is also a useful
way to share information from source other than Harbour (C for
instance).
BIN2U() is the opposite of U2BIN()
Examples:
// Show number of records in DBF
#include "fileio.ch"
PROCEDURE Main()
LOCAL nHandle, cBuffer := Space( 4 )
nHandle := FOpen( "test.dbf" )
IF nHandle != F_ERROR
FSeek( nHandle, 4 )
FRead( nHandle, @cBuffer, hb_BLen( cBuffer ) )
? "Number of records in file:", Bin2U( cBuffer )
FClose( nHandle )
ELSE
? "Can not open file"
ENDIF
RETURN
Convert unsigned short encoded bytes into Harbour numeric
Syntax:
BIN2W( ) --> nNumber
Arguments:
is a character string that contain 16 bit encoded unsigned
short integer (least significant byte first). The first two bytes
are taken into account, the rest if any are ignored.
Returns:
BIN2W() return numeric integer (or 0 if is not a string).
Description:
BIN2W() is one of the low level binary conversion functions, those
functions convert between Harbour numeric and a character
representation of numeric value. BIN2W() take two bytes of encoded
16 bit unsigned short integer and convert it into standard Harbour
numeric value.
You might ask what is the need for such functions, well, first of
all it allow you to read/write information from/to a binary file
(like extracting information from DBF header), it is also a useful
way to share information from source other than Harbour (C for
instance).
BIN2W() is the opposite of W2BIN()
Examples:
// Show header length of a DBF
#include "fileio.ch"
PROCEDURE Main()
LOCAL nHandle, cBuffer := Space( 2 )
nHandle := FOpen( "test.dbf" )
IF nHandle != F_ERROR
FSeek( nHandle, 8 )
FRead( nHandle, @cBuffer, hb_BLen( cBuffer ) )
? "Length of DBF header in bytes:", Bin2W( cBuffer )
FClose( nHandle )
ELSE
? "Can not open file"
ENDIF
RETURN
This function converts a string from an binary value
to a numeric decimal value.
Examples:
Status:
Compliance:
Files:
Library is libmisc
See also:
OctaltoDec(),HexatoDec()
BITTOC()
Lang:
numconv.txt
Component:
hbct
Doc. source:
hbct\doc\en\numconv.txt
Template:
Category:
CT3 number and bit manipulation functions
Subcategory:
Oneliner:
Syntax:
BITTOC (, [,]) ->
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is numconv.prg, library is libct.
See also:
CTOBIT()
BOF()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Test for the beggining-of-file condition
Syntax:
BOF() -->
Arguments:
Returns:
BOF() Logical true (.T.) or false (.F.)
Description:
This function determines if the beggining of the file marker has been
reached. If so, the function will return a logical true (.T.); otherwise,
a logical false (.F.) will be returned.
By default, BOF() will apply to the currently selected database unless
the function is preceded by an alias
Examples:
PROCEDURE Main()
USE tests NEW
DBGOTOP()
? "Is Eof()", EOF()
DBGOBOTTOM()
? "Is Eof()", EOF()
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
EOF(),FOUND(),LASTREC()
BOM()
Lang:
datetime.txt
Component:
hbct
Doc. source:
hbct\doc\en\datetime.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
_B_egin _O_f _M_onth
Syntax:
BOM ([]) -> dDateBeginOfMonth
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
BOM() is compatible with CT3's BOM().
Files:
Source is datetime.prg, library is libct.
See also:
EOM(),BOQ(),EOQ(),BOY(),EOY()
BOM()
Lang:
dates2.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\dates2.txt
Template:
Category:
Date
Subcategory:
Oneliner:
Gets the first day in a month.
Syntax:
BOM( ) --> dBOM
Arguments:
A valid date.
Returns:
The first day in the month.
Description:
This function returns the first day of a given month date.
is any valid expression. It is always required.
If do not want to pass any argument, just use NIL.
Returns:
Description:
This function passes control to the RECOVER statement in a
BEGIN SEQUENCE block.
Examples:
Break( NIL )
Status:
R
Compliance:
C
Files:
Library is vm
See also:
BEGIN SEQUENCE
BROWSE()
Lang:
browse.txt
Component:
harbour
Doc. source:
.\doc\en\browse.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Browse a database file
Syntax:
BROWSE( [, , , ] ) --> lOk
Arguments:
coordinate for top row display.
coordinate for left column display.
coordinate for bottom row display.
coordinate for right column display.
Returns:
BROWSE() return .F. if there is no database open in this work area,
else it return .T.
Description:
BROWSE() is a general purpose database browser, without any
thinking you can browse a file using the following keys:
Key Meaning
Left Move one column to the left (previous field)
Right Move one column to the right (next field)
Up Move up one row (previous record)
Down Move down one row (next record)
Page-Up Move to the previous screen
Page-Down Move to the next screen
Ctrl Page-Up Move to the top of the file
Ctrl Page-Down Move to the end of the file
Home Move to the leftmost visible column
End Move to the rightmost visible column
Ctrl Left Pan one column to the left
Ctrl Right Pan one column to the right
Ctrl Home Move to the leftmost column
Ctrl End Move to the rightmost column
Esc Terminate BROWSE()
On top of the screen you see a status line with the following
indication:
Record ###/### Current record number / Total number of records.
There are no records, the file is empty.
You are in append mode at the bottom of file.
Current record is deleted.
You are at the top of file.
You should pass whole four valid coordinate, if less than four
parameters are passed to BROWSE() the coordinate are default to:
1, 0, MAXROW(), MAXCOL().
Examples:
// this one shows you how to browse around
USE Around
Browse()
Status:
S
Compliance:
C
Files:
Library is rtl
See also:
DBEDIT()*,TBrowse class
CD()
Lang:
ht_file.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_file.txt
Template:
Category:
Dos Tools
Subcategory:
Oneliner:
Change the Current Directory
Syntax:
CD() --> lSuccess
Arguments:
DIR TO BE CHANGED
Returns:
.T. IF SUCESSFUL; otherwise .F.
Description:
CHANGE THE CURRENT DIRECTORY
Examples:
IF CD("OLA")
RETURN .T.
ELSE
RETURN .F.
ENDIF
Status:
Compliance:
Files:
Header is Fileio.ch
See also:
MD(),RD()
CDOW()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Converts a date to the day of week
Syntax:
CDOW() --> cDay
Arguments:
Any date expression.
Returns:
The current day of week.
Description:
This function returns a character string of the day of the week,
from a date expression passed to it.
If a NULL date is passed to the function, the value of the function
will be a NULL byte.
Examples:
? CDOW( Date() )
IF CDOW( Date() + 10 ) == "Sunday"
? "This is a sunny day."
ENDIF
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
DAY(),DOW(),DATE(),CMONTH()
CEILING()
Lang:
ctmath2.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctmath2.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Rounds up a number to the next integer
Syntax:
CEILING (nNumber) -> nUpRoundedNumber
Arguments:
number to round up
Returns:
the rounded number
Description:
The function CEILING() determines the smallest integer that is bigger
than .
Examples:
? ceiling (1.1) --> 2.0
? ceiling (-1.1) --> -1.0
Status:
Ready
Compliance:
CEILING() is compatible with CT3's CEILING().
Files:
Source is math.c, library is libct.
See also:
FLOOR
CELSIUS()
Lang:
num1.txt
Component:
hbct
Doc. source:
hbct\doc\en\num1.txt
Template:
Category:
CT3 numeric functions
Subcategory:
Oneliner:
Temperature conversion Fahrenheit to Celsius
Syntax:
CELSIUS (nDegreeFahrenheit) --> nDegreeCelsius
Arguments:
temperature in degree Fahrenheit
Returns:
temperate in degree Celsius
Description:
CELSIUS() converts temperature values measured in the Fahrenheit scale
to the Celsius scale.
Examples:
// melting point of water in standard conditions
? celsius (32.0) --> 0.0
// boiling point of water in standard conditions
? celsius (212.0) --> 100.0
Status:
Ready
Compliance:
CELSIUS() is compatible with CT3's CELSIUS().
Files:
Source is num1.c, library is libct.
See also:
FAHRENHEIT()
CHARADD()
Lang:
charop.txt
Component:
hbct
Doc. source:
hbct\doc\en\charop.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Adds corresponding ASCII value of two strings
Syntax:
CHARADD (<[@]cString1>, ) --> cAddString
Arguments:
<[@]cString1> first string
second string
Returns:
string with added ASCII values
Description:
The CHARADD() function constructs a new string from the two strings
passed as parameters. To do this, it adds the ASCII values of the
corresponding characters of both strings and places a character in
the resulting string whose ASCII value equals to that sum (modulo 256).
If the first string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If is shorter than and the last character of
has been processed, the function restarts with the first
character of .
Combine corresponding ASCII value of two strings with bitwise AND
Syntax:
CHARAND (<[@]cString1>, ) --> cAndString
Arguments:
<[@]cString1> first string
second string
Returns:
string with bitwise AND combined ASCII values
Description:
The CHARAND() function constructs a new string from the two strings
passed as parameters. To do this, it combines the ASCII values of the
corresponding characters of both strings with a bitwise AND-operation
and places a character in the resulting string whose ASCII value
equals to the result of that operation.
If the first string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If is shorter than and the last character of
has been processed, the function restarts with the first
character of .
Returns the characters on the even positions in a string
Syntax:
CHAREVEN () --> cEvenString
Arguments:
processed string
Returns:
a string containing all character from even positions
in
Description:
The CHAREVEN() function looks for the characters on the even positions
in a given string, collects them and returns them as a string.
Examples:
? CHAREVEN (" H E L L O !") -> "HELLO!"
Status:
Ready
Compliance:
CHAREVEN() is compatible with CT3's CHAREVEN().
Files:
Source is charevod.c, library is ct3.
See also:
CHARODD() CHARMIX()
CHARHIST()
Lang:
charlihb.txt
Component:
hbct
Doc. source:
hbct\doc\en\charlihb.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Generates a character histogram of a string
Syntax:
CHARHIST ([]) -> aCharacterCount
Arguments:
[] is the string for whom the function generates a
character histogram
Default: "" (empty string)
Returns:
an array with 256 elements where the nth element
contains the count of character #(n-1) in cString
Description:
The CHARHIST() function generates a character histogram of those
characters that are contained in . This histogram is stored
in an 256-element array where the nth element contains the count
of ASCII character #(n-1) in .
Examples:
? charhist ("Hello World !")[109] --> 3 // chr(108)=="l"
Status:
Ready
Compliance:
CHARHIST() is only available in Harbour's CT3 library.
Files:
Source is charlist.c, library is libct.
See also:
CHARLIST(),CHARNOLIST(),CHARSLIST()
CHARLIST()
Lang:
charlist.txt
Component:
hbct
Doc. source:
hbct\doc\en\charlist.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Generates a list of all characters in a string
Syntax:
CHARLIST ([]) -> cCharacterList
Arguments:
[] is the string for whom the function generates a list
of all characters
Default: "" (empty string)
Returns:
a list of the characters in
Description:
The CHARLIST() function generates a list of those characters that
are contained in . This list can contain each character
only once, so that its maximum length is 256. The list lists those
characters first that are occuring in first.
Examples:
? charlist ("Hello World !") --> "Helo Wrd!"
Status:
Ready
Compliance:
CHARLIST() is compatible with CT3's CHARLIST().
Files:
Source is charlist.c, library is libct.
See also:
CHARNOLIST(),CHARSLIST(),CHARHIST()
CHARMIRR()
Lang:
charmirr.txt
Component:
hbct
Doc. source:
hbct\doc\en\charmirr.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Mirror a string
Syntax:
CHARMIRR (<[@]cString>, []) -> cMirroredString
Arguments:
<[@]cString> is the string that should be mirrored
[] if set to .T., spaces at the end of
will not be mirrored but kept at the end
Default: .F., mirror the whole string
Returns:
the mirrored string
Description:
The CHARMIRR() function mirrors a string, i.e. the first character
will be put at the end, the second at the last but one position etc..
One can use this function for index searches, but then, the spaces
at the end of the string should not be mirrored.
One can omit the return value of the function by setting the CSETREF()
switch to .T., but must then be passed by reference to get
a result.
String that will be mixed with the characters from
[] String whose characters will be mixed with the one from
.
Default: " " (string with one space char)
Returns:
Mixed string
Description:
The CHARMIX() function mixes the strings and . To
do this it takes one character after the other alternatively from
and and puts them in the output string.
This procedure is stopped when the end of is reached. If
is shorter than , the function will start at
the begin of again. If on the other hand is
longer than , the surplus characters will be omitted.
Examples:
? CHARMIX("ABC", "123") // "A1B2C3"
? CHARMIX("ABCDE", "12") // "A1B2C1D2E1"
? CHARMIX("AB", "12345") // "A1B2"
? CHARMIX("HELLO", " ") // "H E L L O "
? CHARMIX("HELLO", "") // "HELLO"
Status:
Ready
Compliance:
CHARMIX() is compatible with CT3's CHARMIX().
NOTE: CA-Tools version of CHARMIX() will hang
if the second parameter is an empty string, this version will not.
Files:
Source is charmix.c, library is ct3.
See also:
CHAREVEN() CHARODD()
CHARNOLIST()
Lang:
charlist.txt
Component:
hbct
Doc. source:
hbct\doc\en\charlist.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Generates a list of all characters not contained in a string
Syntax:
CHARNOLIST ([]) -> cCharacterList
Arguments:
[] is the string for whom the function generates a list
of all characters not contained in that string
Default: "" (empty string)
Returns:
a list of the characters that are not contained in
Description:
The CHARNOLIST() function generates a list of those characters that
are not contained in . This list can contain each character
only once, so that its maximum length is 256. The list is alphabetically
sorted.
Examples:
? charnolist (charnolist ("Hello World !")) --> " !HWdelor"
Status:
Ready
Compliance:
CHARNOLIST() is compatible with CT3's CHARNOLIST().
Files:
Source is charlist.c, library is libct.
See also:
CHARLIST(),CHARSLIST(),CHARHIST()
CHARNOT()
Lang:
charop.txt
Component:
hbct
Doc. source:
hbct\doc\en\charop.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Process each character in a string with bitwise NOT operation
Syntax:
CHARNOT (<[@]cString>) --> cNotString
Arguments:
<[@]cString> string to be processed
Returns:
string with bitwise negated characters
Description:
The CHARNOT() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise NOT operation
to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation. It can be easily seen that the resulting ASCII-value equals
255 minus input ASCII value.
If the string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
Examples:
? charnot (chr(85)+chr(128)+chr(170)+chr(1)) --> chr(170)+chr(127)+chr(85)+chr(254)
? charnot (charnot ("This is a test!")) --> "This is a test!"
Returns the characters on the odd positions in a string
Syntax:
CHARODD () --> cOddString
Arguments:
processed string
Returns:
a string containing all character from odd positions
in
Description:
The CHARODD() function looks for the characters on the odd positions
in a given string, collects them and returns them as a string.
Examples:
? CHARODD ("H E L L O ! ") -> "HELLO!"
Status:
Ready
Compliance:
CHARODD() is compatible with CT3's CHARODD().
Files:
Source is charevod.c, library is ct3.
See also:
CHAREVEN() CHARMIX()
CHARONE()
Lang:
charone.txt
Component:
hbct
Doc. source:
hbct\doc\en\charone.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Reduce multiple occurences of a character to one
Syntax:
CHARONE ([,] ) -> cReducedString
Arguments:
[] specifies the characters the multiple
occurences of which should be reduced to one
Default: All characters.
specifies the processed string
Returns:
the string with the reduced occurences
Description:
The CHARONE() function reduces multiple occurences of characters in
to a single one. It is important to note that the multiple
occurences must occur directly one behind the other. This behaviour is
is in contrast to the CHARLIST() function.
Examples:
? CHARONE("122333a123") // "123a123"
? CHARONE("A B CCCD") // "A B CD"
? CHARONE(" ", "A B A B") // "A B A B"
? CHARONE("o", "122oooB12o") // "122oB12o"
Status:
Ready
Compliance:
CHARONE() is compatible with CT3's CHARONE().
Files:
Source is charone.c, library is ct3.
See also:
CHARREM() WORDONE()
CHARONLY()
Lang:
charonly.txt
Component:
hbct
Doc. source:
hbct\doc\en\charonly.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Intersectional set of two strings based on characters
Syntax:
CHARONLY (, ) -> cReducedString
Arguments:
specifies the characters that must not be
deleted in .
is the string that should be processed
Returns:
A string with all characters deleted but those
specified in .
Description:
The CHARONLY() function calculates the intersectional set of two
strings. To do this, it deletes all characters from that
do not appear in .
Combine corresponding ASCII value of two strings with bitwise OR
Syntax:
CHAROR (<[@]cString1>, ) --> cOrString
Arguments:
<[@]cString1> first string
second string
Returns:
string with bitwise OR combined ASCII values
Description:
The CHAROR() function constructs a new string from the two strings
passed as parameters. To do this, it combines the ASCII values of the
corresponding characters of both strings with a bitwise OR-operation
and places a character in the resulting string whose ASCII value
equals to the result of that operation.
If the first string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If is shorter than and the last character of
has been processed, the function restarts with the first
character of .
Examples:
// set the LSB
? charor ("012345678", chr(1)) --> "113355779"
? charor ("012345678", chr(1)+chr(3)) --> "133357779"
is a string of characters that should be replaced
<[@]cString> is the processed string
is a string of characters that replace the one
of
[] sets the replacement method (see description)
Default: .F.
Returns:
the processed string
Description:
The CHARREPL() function replaces certain characters in
with others depending on the setting of .
If is set to .F., the function takes the characters of
one after the other, searches for them in
and, if successful, replaces them with the corresponding character
of . Be aware that if the same characters occur
in both and , the character on a
certain position in can be replaced multiple times.
if is set to .T., the function takes the characters in
one after the other, searches for them in and, if
successful, replaces them with the corresponding character of
. Note that no multiple replacements are possible
in this mode.
If is shorter than , the last
character of is used as corresponding character
for the the "rest" of .
One can omit the return value by setting the CSETREF() switch to .T.,
but then one must pass by reference to get the result.
Process each character in a string with bitwise ROLL LEFT operation
Syntax:
CHARRLL (<[@]cString>, ) --> cRLLString
Arguments:
<[@]cString> string to be processed
number of bit positions to be rolled to the left
Returns:
string with bitwise rolled left characters
Description:
The CHARRLL() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise ROLL LEFT
(RLL) operation to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation.
Be aware that, in contrast to CHARSHL(), bits rolled out on
the left are put in again on the right.
If the string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
Process each character in a string with bitwise ROLL RIGHT operation
Syntax:
CHARRLR (<[@]cString>, ) --> cRLRString
Arguments:
<[@]cString> string to be processed
number of bit positions to be rolled to the right
Returns:
string with bitwise rolled right characters
Description:
The CHARRLR() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise ROLL RIGHT
(RLR) operation to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation.
Be aware that, in contrast to CHARSHR(), bits rolled out on
the right are put in again on the left.
If the string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
Process each character in a string with bitwise SHIFT LEFT operation
Syntax:
CHARSHL (<[@]cString>, ) --> cSHLString
Arguments:
<[@]cString> string to be processed
number of bit positions to be shifted to the left
Returns:
string with bitwise shifted left characters
Description:
The CHARSHL() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise SHIFT LEFT
(SHL) operation to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation.
Be aware that bits shifted out of the byte are lost. If you need
a bit rotation, use the CHARRLL() function instead.
If the string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
Process each character in a string with bitwise SHIFT RIGHT operation
Syntax:
CHARSHR (<[@]cString>, ) --> cSHRString
Arguments:
<[@]cString> string to be processed
number of bit positions to be shifted to the right
Returns:
string with bitwise shifted right characters
Description:
The CHARSHR() function constructs a new string from the string
passed as parameter. To do this, it performs a bitwise SHIFT RIGHT
(SHR) operation to the characters of the string and places a character in
the resulting string whose ASCII value equals to the result of that
operation.
Be aware that bits shifted out of the byte are lost. If you need
a bit rotation, use the CHARRLR() function instead.
If the string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
Generates a sorted list of all characters in a string
Syntax:
CHARSLIST ([]) -> cSortedCharacterList
Arguments:
[] is the string for whom the function generates a
sorted list of all characters
Default: "" (empty string)
Returns:
a sorted list of the characters in
Description:
The CHARLIST() function generates a sorted list of those characters that
are contained in . This list can contain each character
only once, so that its maximum length is 256. The function
gives the same result as CHARSORT(CHARLIST())
Examples:
? charslist ("Hello World !") --> " !HWdelor"
Status:
Ready
Compliance:
CHARSLIST() is only available in Harbour's CT3 library.
<[@]cString> is the string that should be processed
[] specifies the length of the elements that
should be sorted
Default: 1
[] specifies how many characters within one
element should be used for comparison
Default:
[] specifies the number of characters at the
beginning of that should be ignored
in the sort process
Default: 0
[] specifies the offset of the comparison string
within a element
Default: 0
[] specifies how many characters in ,
starting from the position,
should be sorted
Default: len(cString)-nIgnoreCharacters
[]) specifies whether the process should
sort descending or not
Returns:
the string resulting from the sort process
Description:
The CHARSORT function sorts the characters within a string .
With the parameters and , you can
determine that only the substring from position +1
to position + within should
be sorted.
The sorting algorithm is determined with the other parameters.
specifies the length of one element, i.e. there are
/ elements that are sorted. Note that
surplus characters are not sorted but stay at their position.
To do the sorting, the function uses the Quicksort algorithm implemented
in the C-lib qsort() function. This algorithm needs to know how to compare
and order two elements. This is done by comparing the ASCII values of
a substring within each element. This substring is determined by the
parameters and and the order
by .
By setting the CSETREF() switch to .T., one can omit the return value
of the function, but one must then pass by reference.
Subtracts corresponding ASCII value of two strings
Syntax:
CHARSUB (<[@]cString1>, ) --> cSubString
Arguments:
<[@]cString1> first string
second string
Returns:
string with subtracted ASCII values
Description:
The CHARSUB() function constructs a new string from the two strings
passed as parameters. To do this, it subtracts the ASCII values of the
corresponding characters of both strings and places a character in
the resulting string whose ASCII value equals to that difference (modulo 256).
If the first string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If is shorter than and the last character of
has been processed, the function restarts with the first
character of .
<[@]cString> is the string that should be processed
Returns:
a string where neighbour characters are swapped
Description:
The CHARSWAP() function loops through in steps of two
characters and exchanges the characters from the odd and the even
positions.
By setting the CSETREF() switch to .T., one can omit the return value
of this functin, but one must then pass by reference.
- top row number, default 0
- left column number, default 0
- top row number, default MaxRow()
- right column number, default MaxCol()
- new character for the screen area,
as a numeric value in the range of 0 to
255 or as a character string, default value is the CLEARB.
- character to exchange. Specify the parameter
as a numeric in the range of 0 to 255
or as a character string. The default is to exchange all characters.
Returns:
Returns an empty string.
Description:
Exchanges particular characters in a screen area.
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is screen1.c, library is libct.
See also:
CHARXOR()
Lang:
charop.txt
Component:
hbct
Doc. source:
hbct\doc\en\charop.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Combine corresponding ASCII value of two strings with bitwise XOR
Syntax:
CHARXOR (<[@]cString1>, ) --> cXOrString
Arguments:
<[@]cString1> first string
second string
Returns:
string with bitwise XOR combined ASCII values
Description:
The CHARXOR() function constructs a new string from the two strings
passed as parameters. To do this, it combines the ASCII values of the
corresponding characters of both strings with a bitwise XOR-operation
and places a character in the resulting string whose ASCII value
equals to the result of that operation.
If the first string is passed by reference, the resulting string is
stored in , too. By setting the CSETREF()-switch to .T.,
the return value can be omitted.
If is shorter than and the last character of
has been processed, the function restarts with the first
character of .
Examples:
// easy encryption
? charxor ("This is top secret !", "My Password") -->
This function returns the ASCII character code for . The
number expressed must be an integer value within the range of 0 to
255 inclusive. The CHR() function will send the character returned
to whatever device is presently set.
The CHR() function may be used for printing special codes as well
as normal and graphics character codes.
Examples:
? CHR( 32 )
? chr( 215 )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ASC(), INKEY()
CLASS
Lang:
command.txt
Component:
harbour
Doc. source:
.\doc\en\command.txt
Template:
Command
Category:
Class
Subcategory:
Definition
Oneliner:
Define a Class for Object Oriented Programming
Syntax:
[CREATE] CLASS [ [,] ] [STATIC]
Arguments:
Name of the class to define. By tradition, Harbour
classes start with "T" to avoid collisions with user-
created classes.
The Parent class(es) to use for inheritance.
Harbour supports Multiple Inheritance.
STATIC This clause causes the class function to be declared
as a static function. It will therefore not be available outside the current module.
Returns:
Description:
CLASS creates a class from which you can create objects.
The CLASS command begins the class specification, in which the DATA
elements (also known as instance variables) and METHODS of the
class are named. The following scoping commands may also appear.
They control the default scope of DATA and METHOD commands that follow them.
EXPORTED:
VISIBLE:
HIDDEN:
PROTECTED:
The class specification ends with the END CLASS command.
Classes can inherit from multiple , and the chain of
inheritance can extend to many levels.
A program uses a Class by calling the Class Constructor, usually the
New() method, to create an object. That object is usually assigned
to a variable, which is used to access the DATA elements and
methods.
Harbour's OOP syntax and implementation supports Scoping (Protect, Hidden and Readonly)
and Delegating, and is largely compatible with Class(y)(tm), TopClass(tm)
and Visual Objects(tm).
Examples:
CREATE CLASS TBColumn
VAR Block // Code block to retrieve data for the column
VAR Cargo // User-definable variable
VAR ColorBlock // Code block that determines color of data items
VAR ColSep // Column separator character
VAR DefColor // Array of numeric indexes into the color table
VAR Footing // Column footing
VAR FootSep // Footing separator character
VAR Heading // Column heading
VAR HeadSep // Heading separator character
VAR Width // Column display width
VAR ColPos // Temporary column position on screen
METHOD New() // Constructor
ENDCLASS
Status:
R
Compliance:
H
Files:
See also:
HBClass(),Object Oriented Programming,DATA,METHOD
CLASSDATA
Lang:
command.txt
Component:
harbour
Doc. source:
.\doc\en\command.txt
Template:
Command
Category:
Class
Subcategory:
Data
Oneliner:
Define a CLASSDATA variable for a class (NOT for an Object!)
Syntax:
CLASSDATA [,] [ AS ] [ INIT ]
Arguments:
Name of the DATA
Optional data type specification from the following:
Character, Numeric, Date, Logical, Codeblock, Nil
Optional initial value at program startup
Returns:
Description:
CLASSDATA variables can also be thought of as the "properties" of an
entire class. Each CLASSDATA exists only once, no matter how many
objects are created. A common usage is for a counter that is
incremented whenever an object is created and decremented when one
is destroyed, thus monitoring the number of objects in existance
for this class.
You can use the "AS " clause to enforce that the CLASSDATA is
maintained as a certain type. Otherwise it will take on the type of
whatever value is first assigned to it.
Use the "INIT " clause to initialize that DATA to
whenever the class is first used.
Examples:
CREATE CLASS TWindow
DATA hWnd, nOldProc
CLASSDATA lRegistered AS LOGICAL
ENDCLASS
Status:
R
Compliance:
H
Files:
See also:
Object Oriented Programming,CLASS,METHOD,DATA
CLIPINIT()
Lang:
hvm.txt
Component:
harbour
Doc. source:
.\doc\en\hvm.txt
Template:
Function
Category:
API
Subcategory:
Internal
Oneliner:
Initialize various Harbour sub-systems
Syntax:
CLIPINIT() --> NIL
Arguments:
none.
Returns:
CLIPINIT() always return NIL.
Description:
CLIPINIT() is one of the pre-defined INIT PROCEDURE and is executed
at program startup. It declare an empty MEMVAR PUBLIC array called
GetList that is going to be used by the Get system. It activates the
default error handler, and (at least for the moment) calls the
function that sets the default help key.
Examples:
Status:
R
Compliance:
It is said that CLIPINIT() should not call the function that sets
the default help key since CA-Cl*pper does it in some other place.
Files:
See also:
INIT PROCEDURE
CMONTH()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Return the name of the month.
Syntax:
CMONTH() --> cMonth
Arguments:
Any date expression.
Returns:
The current month name
Description:
This function returns the name of the month (January,February,etc.)
from a date expression passed to it.
If a NULL date is passed to the function, the value of the function
will be a NULL byte.
Examples:
? CMonth( Date() )
IF CMonth( Date() + 10 ) =="March"
? "Have you done your system BACKUP?"
ENDIF
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
CDOW(),DATE(),MONTH(),YEAR(),DOW(),DTOC()
COL()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Function
Category:
API
Subcategory:
Terminal
Oneliner:
Returns the current screen column position
Syntax:
COL() --> nPosition
Arguments:
None.
Returns:
Current column position
Description:
This function returns the current cursor column position. The value
for this function can range between 0 and MAXCOL().
Examples:
? Col()
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ROW(),MAXROW(),MAXCOL()
COLORREPL()
Lang:
screen1.txt
Component:
hbct
Doc. source:
hbct\doc\en\screen1.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Syntax:
COLORREPL([], []) --> cNull
Arguments:
Designates the new attribute. The default is
CLEARA.
Designates the old attribute to exchange. The
default is all existing attributes.
Designates the alphanumeric color attribute that is
converted in NN/NN or CC/CC form.
Returns:
COLORTON() returns a number that corresponds to the combined numeric
color attribute.
Description:
COLOR TO (N)umeric
The function changes an alphanumeric color attribute from NN/NN or
CC/CC into a combined numeric attribute. These combined attribute
values are useful with the CA-Cl*pper Tools functions STRSCREEN(),
SCREENMIX(), SCREENATTR(), and the CA-Cl*pper commands
SAVE/RESTORE SCREEN.
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is color.c, library is libct.
See also:
COLORWIN()
Lang:
screen1.txt
Component:
hbct
Doc. source:
hbct\doc\en\screen1.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Syntax:
COLORWIN([], [], [], [],
[], []) --> cNull
Arguments:
Designates the topmost line to begin processing. The
default is the cursor line.
Designates the leftmost column to begin processing. The
default is the cursor column.
Designates the bottommost line that is processed.
The default is the last screen line or window line.
Designates the rightmost column to clear. The default
is the right screen border or window border.
Designates the new attribute to replace the old
one. The default is the standard attribute CLEARA.
Designates the old character to exchange. The
default is "exchange all attributes".
Returns:
Returns an empty string.
Description:
Exchanges particular attributes in a screen area
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is screen1.c, library is libct.
See also:
Command line utility
Lang:
cmdline.txt
Component:
harbour
Doc. source:
.\doc\en\cmdline.txt
Template:
Document
Category:
Document
Subcategory:
Compiler
Oneliner:
Compiler Options
Syntax:
Arguments:
Returns:
Description:
This spec goes for CLIPPERCMD, HARBOURCMD, Harbour compiler and
#pragma directives in the source code.
The command line always overrides the envvar.
Note that some switches are not accepted in envvar, some others in
#pragmas.
First the parser should start to step through all the tokens in the
string separated by whitespace. (or just walk through all argv[])
1.) If the token begins with "-", it should be treated as a new style
switch.
One or more switch characters can follow this. The "-" sign inside
the token will turn off the switch.
If the switch has an argument all the following characters are
treated as part of the argument.
The "/" sign has no special meaning here.
Switch Result option
-wn ( W N )
-w-n ( !W N )
-wi/harbour/include/ ( W I=/harbour/include/ )
-wi/harbour/include/n ( W I=/harbour/include/n )
-wes0n ( W ES=0 N )
-wen ( W [invalid switch: e] N )
-wesn ( W ES=default(0) N )
-wses ( W S ES=default(0) )
-wess ( W ES=default(0) S )
- ( [invalid switch] )
-w-n-p ( !W !N P )
-w-n-p- ( !W !N !P )
-w- -w -w- ( finally: !W )
2.) If the token begins with "/", it should be treated as a compatibility
style switch.
The parser scans the token for the next "/" sign or EOS and treats
the resulting string as one switch.
This means that a switch with an argument containing "/" sign has
some limitations. This may be solved by allowing the usage of quote
characters. This is mostly a problem on systems which use "/" as
path separator.
The "-" sign has no special meaning here, it can't be used to
disable a switch.
Switch Result option
/w/n ( W N )
/wo/n ( [invalid switch: wo] N )
/ihello/world/ ( I=hello [invalid switch: world] [invalid switch: /] )
/i"hello/world/"/w ( I=hello/world/ W )
/ihello\world\ ( I=hello\world\ )
3.) If the token begins with anything else it should be skipped.
The Harbour switches are always case insensitive.
In the Harbour commandline the two style can be used together:
harbour -wnes2 /gc0/q0 -iC:\hello
Exceptions:
- Handlig of the /CREDIT undocumented switch on Harbour command line
is unusual, check the current code for this.
- The CLIPPER, HARBOUR and Harbour application command line parsing
is a different beast, see cmdarg.c for a NOTE.
Notes:
- All occurences where a path is accepted, Harbour should handle the
quote char to specify path containing space, negative sign, slash,
or any other chars with special meaning.
/i"C:/hello/"
-i"C:/hello-n"
/i"C:/Program Files/"
-i"C:/Program Files/"
Just some examples for the various accepted forms:
//F20 == /F20 == F20 == F:20 == F20X
//TMPPATH:C:\hello
F20//TMPPATH:/temp///F:30000000 NOIDLE
F0NOIDLEX10
SQUAWKNOIDLE
"//" should always be used on the command line.
Examples:
Status:
Compliance:
Files:
See also:
Compiler Options
Compiler Options
Lang:
compiler.txt
Component:
harbour
Doc. source:
.\doc\en\compiler.txt
Template:
Document
Category:
Document
Subcategory:
Compiler
Oneliner:
Compiler Options
Syntax:
Arguments:
Returns:
Description:
Invoking the Harbour compiler:
==============================
harbour [options]
or
harbour [options]
or
harbour [options] [options]
The command line options have to be separated by at least one space.
The option can start with either '/' character or '-' character.
The Harbour command line options:
=================================
/a automatic memvar declaration
=================
This causes all variables declared by PARAMETER, PRIVATE or PUBLIC
statements to be automatically declared as MEMVAR variables.
/b debug info
=================
The compiler generates all information required for debugging
/d[=] #define
=================
/es[] set exit severity
=================
/es or /es0 - all warnings are ignored and exit code returned by
the compiler (accessed by DOS ERRORLEVEL command)
is equal to 0 if there are no errors in compiled
source file.
/es1 - any warnings generate a non-zero exit code, but
output is still created.
/es2 - all warnings are treated as errors and no output
file is created. The exit code is set to a non-zero
value.
/g output type generated is
=================
/gc[] output type: C source (.c) (default)
: 0=compact 1=normal 2=verbose (default)
3=generate real C code instead of PCODE
array called by a C wrapper.
/go output type: Platform dependant object module
/gh output type: Harbour Portable Object (.hrb)
/i add #include file search path
=================
/k enable compatibility mode
=================
/kc clear all flags (strict CA-Cl*pper compatibility)
/kh Harbour extensions (default)
/ki HB_INLINE support enabled (default)
/kr use runtime settings for the macro compiler
/ks enable support for strings as array of bytes (default)
/kx other Xbase++ dialects extensions (default)
/kJ disable optimalization of jump and noop pcodes
/k? invoke help information
/l suppress line number information
=================
The compiler does not generate the source code line numbers in
the output file. The PROCLINE() function will return 0 for
modules compiled using this option.
/m compile current module only
=================
/n no implicit starting procedure
=================
The compiler does not create a procedure with the same name as
the compiled file. This means that any declarations placed
before the first PROCEDURE or FUNCTION statement have file-
wide scope and can be accessed/used in all functions/procedures
defined in the compiled source file. All executable statements
placed at the beginning of the file and before the first
PROCEDURE/FUNCTION statement are ignored.
/o output file drive and/or path
=================
/p generate pre-processed output (.ppo) file
=================
The compiler only creates the file that contains the result of
pre-processing the source file.
/q quiet
=================
The compiler does not print any messages during compiling
(except the copyright info).
/q0 be really quiet and don't display even the copyright info
/r[] request linker to search (or none)
=================
Currently not supported in Harbour.
/r= sets maximum number of preprocessor iterations
=================
This set the maximum number of preprocessor iterations
during processing the source code. If this switch is not
used then the preprocessor stops after 1024 iterations.
This value is used to stop processing of infinite loops,
for example:
#command ( => (,7
/s syntax check only
=================
The compiler checks the syntax only. No output file is generated.
/t path for temp file creation
=================
Currently not used in Harbour (the Harbour compiler does not
create any temporary files).
/u[] use command definition set in (or none)
=================
/v variables are assumed M->
=================
All undeclared or unaliased variables are assumed MEMVAR
variables (private or public variables). If this switch is not
used then the scope of such variables is checked at runtime.
/w[] set warning level number (0..4, default 1)
=================
/w0 - no warnings
/w or /w1 - CA-Cl*pper compatible warnings
/w2 - some useful warnings missed in CA-Cl*pper
/w3 - warnings generated for Harbour language extensions
and also enables strong type checking but only
warns against declared types, or types which may be
calculated at compile time
/w4 - Enables warning about suspicious operations, which
means if you mix undeclared types, or types which
can not be calculated at compile time,together with
declared types, a warning will be generated.
/x[] set symbol init function name prefix (for .c only)
=================
Sets the prefix added to the generated symbol init function name
(in C output currently). This function is generated
automatically for every PRG module compiled. This additional
prefix can be used to suppress problems with duplicated symbols
during linking an application with some third party libraries.
/y trace lex & yacc activity
=================
The Harbour compiler uses the FLEX and YACC utilities to parse
the source code and to generate the required output file. This
option traces the activity of these utilities.
/z suppress logical shortcutting (.and. & .or.)
=================
Compilation in batch mode.
==========================
@ compile list of modules in
=================
Not supported yet.
Known incompatibilities between Harbour and CA-Cl*pper compilers
=============================================================
NOTE:
If you want a 100% compatible runtime libraries then
you have to define HARBOUR_STRICT_CLIPPER_COMPATIBILITY. This
option should be defined in the file include/hbsetup.h (in fact this
option is placed in a comment by default - you need to remove the
/* */ characters only). This change has to be done before invoking
the make utility.
Handling of undeclared variables
================================
When a value is assigned to an undeclared variable and the '-v'
command line option is not used, then the CA-Cl*pper compiler assumes
that the variable is a PRIVATE or a PUBLIC variable and generates
POPM (pop memvar) opcode.
When the value of an undeclared variable is accessed and the '-v'
command line option is not used, the CA-Cl*pper compiler generates PUSHV
(push variable) opcode that determines the type of variable at runtime.
If a field with the requested name exists in the current workarea then
its value is used. If there is no field then a PRIVATE or a PUBLIC
variable is used (if exists).
The Harbour compiler generates an opcode to determine the type of
variable at runtime (POPVARIABLE or PUSHVARIABLE) in both cases
(assignment and access).
The difference can be checked by the following code:
PROCEDURE Main()
PRIVATE myname
DBCREATE( "TEST", { { "MYNAME", "C", 10, 0} } )
USE test NEW
SELECT test
APPEND BLANK
FIELD->myname := "FIELD"
MEMVAR->myname := "MEMVAR"
myname := myname + " assigned"
// In CA-Cl*pper: "FIELD", In Harbour: "FIELD assigned"
? FIELD->myname
// In CA-Cl*pper: "MEMVAR assigned", In Harbour: "MEMVAR"
? MEMVAR->myname
USE
RETURN
Passing an undeclared variable by the reference
===============================================
The CA-Cl*pper compiler uses the special opcode PUSHP to pass a
reference to an undeclared variable ( '@' operator ). The type of
passed variable is checked at runtime (field or memvar). However,
field variables cannot be passed by reference. This means that
CA-Cl*pper checks the memvar variable only and doesn't look for a field.
This is the reason why the Harbour compiler uses the usual
PUSHMEMVARREF opcode in such cases. Notice that the runtime behavior
is the same in CA-Cl*pper and in Harbour - only the generated opcodes
are different.
Handling of object messages
===========================
The HARBOUR_STRICT_CLIPPER_COMPATIBILITY setting determines
the way chained send messages are handled.
For example, the following code:
a:b( COUNT() ):c += 1
will be handled as:
a:b( COUNT() ):c := a:b( COUNT() ):c + 1
in strict CA-Cl*pper compatibility mode and
temp := a:b( COUNT() ), temp:c += 1
in non-strict mode.
In practice, CA-Cl*pper will call the COUNT() function two times:
the first time before addition and the second one after addition.
In Harbour, COUNT() will be called only once, before addition.
The Harbour (non-strict) method is:
1) faster
2) it guarantees that the same instance variable of the same object
will be changed
(See also: src/compiler/expropt.c)
Initialization of static variables
==================================
There is a difference in the initialization of static
variables that are initialized with a codeblock that refers to
a local variable. For example:
PROCEDURE TEST()
LOCAL MyLocalVar
STATIC MyStaticVar := {|| MyLocalVar }
MyLocalVar :=0
? EVAL( MyStaticVar )
RETURN
The above code compiles fine in CA-Cl*pper, but it generates a
runtime error Error/BASE 1132 Bound error: array access
Called form (b)STATICS$(0)
In Harbour this code generates a compile time error:
Error E0009 Illegal variable (b) initializer: 'MyLocalVar'
Both CA-Cl*pper and Harbour are handling all local variables used in a
codeblock in a special way: they are detached from the local stack
of function/procedure where they are declared. This allows access to
these variables after the exit from a function/procedure. However,
all static variables are initialized in a separate procedure
('STATICS$' in CA-Cl*pper and '(_INITSTATICS)' in Harbour) before the
main procedure and before all INIT procedures. The local variables
don't exist on the eval stack when static variables are initialized,
so they cannot be detached.
Examples:
Status:
Compliance:
Files:
See also:
COPY FILE
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Command
Category:
Command
Subcategory:
FileSys
Oneliner:
Copies a file.
Syntax:
COPY FILE TO
Arguments:
Filename of source file
Filename of target file
Returns:
Description:
This command makes an exact copy of and names it .
Both files must have the file extension included; the drive and the
directory names must also be specified if they are different from
the default drive and/or director. also can refer to a OS
device (e.g. LPT1). This command does not observe the SET PATH TO or
SET DEFAULT TO settings.
Examples:
COPY FILE C:\harbour\tests\adirtest.prg TO C:\temp\adirtest.prg
COPY FILE C:\harbour\utils\hbdoc\gennf.prg TO LPT1
Status:
R
Compliance:
C
Files:
See also:
ERASE,RENAME,FRENAME(),FERASE()
COPY STRUCTURE
Lang:
dbstrux.txt
Component:
harbour
Doc. source:
.\doc\en\dbstrux.txt
Template:
Command
Category:
Command
Subcategory:
Database
Oneliner:
Create a new database based on current database structure
Syntax:
COPY STRUCTURE TO [FIELDS ]
Arguments:
TO is the name of the new database file to
create. (.dbf) is the default extension if none is given. It can be
specified as a literal file name or as a character expression
enclosed in parentheses.
FIELDS is an optional list of field names to copy
from the currently open database in the specified order, the default
is all fields. Names could be specified as uppercase or lowercase.
Returns:
Description:
COPY STRUCTURE create a new empty database file with a structure
that is based on the currently open database in this work-area.
COPY STRUCTURE can be use to create a sub-set of the currently
open database, based on a given field list.
COPY STRUCTURE command is preprocessed into __dbCopyStruct()
function during compile time.
Examples:
// Create a new file that contains the same structure
USE TEST
COPY STRUCTURE TO MyCopy
// Create a new file that contains part of the original structure
USE TEST
COPY STRUCTURE TO SomePart FIELDS name, address
Copy current database structure into a definition file
Syntax:
COPY STRUCTURE EXTENDED TO
Arguments:
The name of the target definition file to
create. (.dbf) is the default extension if none is given. It can be
specified as a literal file name or as a character expression
enclosed in parentheses.
Returns:
Description:
COPY STRUCTURE EXTENDED create a new database named with
a pre-defined structure (also called "structure extended file"):
Field name Type Length Decimals
FIELD_NAME C 10 0
FIELD_TYPE C 1 0
FIELD_LEN N 3 0
FIELD_DEC N 3 0
Each record in the new file contains information about one field in
the original file. CREATE FROM could be used to create a database
from the structure extended file.
For prehistoric compatibility reasons, Character fields which are
longer than 255 characters are treated in a special way by writing
part of the length in the FIELD_DEC according to the following
formula (this is done internally):
FIELD->FIELD_DEC := int( nLength / 256 )
FIELD->FIELD_LEN := ( nLength % 256 )
Later if you want to calculate the length of a field you can use
the following formula:
nLength := IIF( FIELD->FIELD_TYPE == "C", ;
FIELD->FIELD_DEC * 256 + FIELD->FIELD_LEN, ;
FIELD->FIELD_LEN )
COPY STRUCTURE EXTENDED command is preprocessed into
__dbCopyXStruct() function during compile time.
Examples:
// Open a database, then copy its structure to a new file,
// Open the new file and list all its records
USE Test
COPY STRUCTURE EXTENDED TO TestStru
USE TestStru
LIST
The function COS() calculates the cosine of an angle whose size is
given in radiants (full angle equals 2*Pi - see DTOR() for angle size
given in degress).
A common geometric interpretation of the COS() function is the
ankathede-hypotenuse-ratio of a right-angled triangle.
The function COSH() calculates the hyperbolic cosine of the argument.
In analytical mathematics it is defined as 1/2*(exp(nArea)+exp(-nArea)).
A common geometric interpretation of the COSH() function is the
maximum x value of the points in the area with the given size ,
that is bound by the x axis, a straight line through the point of
origin (this one is fixed by the area) and the hyperbola x^2-y^2=1.
The function COT() calculates the cotangent of an angle whose size is
given in radiants (full angle equals 2*Pi - see DTOR() for angle size
given in degress).
A common geometric interpretation of the COT() function is the
ankathede-counterkathede-ratio of a right-angled triangle, or,
cot(x) = cos(x)/sin(x)=1/tan(x).
Count a certain character at the beginning of a string
Syntax:
COUNTLEFT (, []) -> nCount
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
COUNTLEFT() is compatible with CT3's COUNTLEFT().
Files:
Source is count.c, library is libct.
See also:
COUNTRIGHT()
COUNTRIGHT()
Lang:
count.txt
Component:
hbct
Doc. source:
hbct\doc\en\count.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Count a certain character at the end of a string
Syntax:
COUNTRIGHT (, []) -> nCount
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
COUNTRIGHT() is compatible with CT3's COUNTRIGHT().
Files:
Source is count.c, library is libct.
See also:
COUNTLEFT()
CREATE
Lang:
dbstrux.txt
Component:
harbour
Doc. source:
.\doc\en\dbstrux.txt
Template:
Command
Category:
Command
Subcategory:
Database
Oneliner:
Create empty structure extended file
Syntax:
CREATE [VIA ] [ALIAS ]
Arguments:
is the target file name to create and then open. (.dbf)
is the default extension if none is given. It can be specified as
literal file name or as a character expression enclosed in
parentheses.
VIA is RDD name to create target with. If omitted,
the default RDD is used. It can be specified as literal name or as a
character expression enclosed in parentheses.
ALIAS is an optional alias to USE the target file
with. If not specified, alias is based on the root name of
.
Returns:
Description:
CREATE a new empty structure extended file with the name
and then open it in the current work-area. The new file has the
following structure:
Field name Type Length Decimals
FIELD_NAME C 10 0
FIELD_TYPE C 1 0
FIELD_LEN N 3 0
FIELD_DEC N 3 0
CREATE command is preprocessed into __dbCopyStruct() function during
compile time and use this mode.
Examples:
// CREATE a new structure extended file, append some records and
// then CREATE FROM this file a new database file
CREATE template
APPEND BLANK
FIELD->FIELD_NAME := "CHANNEL"
FIELD->FIELD_TYPE := "N"
FIELD->FIELD_LEN := 2
FIELD->FIELD_DEC := 0
APPEND BLANK
FIELD->FIELD_NAME := "PROGRAM"
FIELD->FIELD_TYPE := "C"
FIELD->FIELD_LEN := 20
FIELD->FIELD_DEC := 0
APPEND BLANK
FIELD->FIELD_NAME := "REVIEW"
FIELD->FIELD_TYPE := "C" // this field is 1000 char long
FIELD->FIELD_LEN := 232 // 1000 % 256 = 232
FIELD->FIELD_DEC := 3 // 1000 / 256 = 3
CLOSE
CREATE TV_Guide FROM template
Create new database file from a structure extended file
Syntax:
CREATE FROM [VIA ] [NEW] [ALIAS ]
Arguments:
is the target file name to create and then open. (.dbf)
is the default extension if none is given. It can be specified as
literal file name or as a character expression enclosed in
parentheses.
FROM is a structure extended file name from
which the target file is going to be built. It can be
specified as literal file name or as a character expression enclosed
in parentheses.
VIA is RDD name to create target with. If omitted,
the default RDD is used. It can be specified as literal name or as a
character expression enclosed in parentheses.
NEW open the target file name in the next
available unused work-area and making it the current work-area. If
omitted open the target file in current work-area.
ALIAS is an optional alias to USE the target file
with. If not specified, alias is based on the root name of
.
Returns:
Description:
CREATE FROM open a structure extended file where each
record contain at least the following fields (in no particular
order): FIELD_NAME, FIELD_TYPE, FIELD_LEN and FIELD_DEC. Any other
field is ignored. From this information the file is
then created and opened in the current or new work-area (according to
the NEW clause), if this is a new work-area it becomes the current.
For prehistoric compatibility reasons, structure extended file
Character fields which are longer than 255 characters should be
treated in a special way by writing part of the length in the
FIELD_DEC according to the following formula:
FIELD->FIELD_DEC := int( nLength / 256 )
FIELD->FIELD_LEN := ( nLength % 256 )
CREATE FROM command is preprocessed into __dbCopyStruct() function
during compile time and uses this mode.
All CT3 functions are very compliant in their reaction to wrong
parameters. By using the CSETARGERR() function, you can make the
library throw an error with the severity . It is then
up to the error handler to substitute the return value.
can be one of the severity modes defined in ct.ch:
CT_ARGERR_WHOCARES corresponds to ES_WHOCARES
CT_ARGERR_WARNING corresponds to ES_WARNING
CT_ARGERR_ERROR corresponds to ES_ERROR
CT_ARGERR_CATASTROPHIC corresponds to ES_CATASTROPHIC
CT_ARGERR_IGNORE
The last is the default behaviour and switches any argument error
throwing off.
Examples:
Status:
Ready
Compliance:
CSETARGERR() is a new function in Harbour's CT3 library.
Files:
Source is ct.c, library is libct.
See also:
CSETATMUPA()
Lang:
ctstr.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctstr.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Determine "multi-pass" behaviour in some string functions
Syntax:
CSETATMUPA ([]) -> lOldSwitch
Arguments:
[] .T. -> turn "multi-pass" on
.F. -> turn "multi-pass" off
Returns:
lOldSwitch old (if lNewSwitch is a logical value) or
current state of the switch
Description:
CSETATMUPA determines how the following CT3 string functions
ATNUM() AFTERATNUM() BEFORATNUM()
ATREPL() NUMAT() ATADJUST()
WORDTOCHAR() WORDREPL()
perform their work. See the respective function documentation for a
further description how the switch influences these functions.
Determine return value of reference sensitive CT3 string functions
Syntax:
CSETREF ([]) -> lOldSwitch
Arguments:
[] .T. -> suppress return value
.F. -> do not suppress return value
Returns:
lOldSwitch old (if lNewSwitch is a logical value) or
current state of the switch
Description:
Within the CT3 functions, the following functions do not
change the length of a string passed as parameter while
transforming this string:
ADDASCII() BLANK() CHARADD()
CHARAND() CHARMIRR() CHARNOT()
CHAROR() CHARRELREP() CHARREPL()
CHARSORT() CHARSWAP() CHARXOR()
CRYPT() JUSTLEFT() JUSTRIGHT()
POSCHAR() POSREPL() RANGEREPL()
REPLALL() REPLLEFT() REPLRIGHT()
TOKENLOWER() TOKENUPPER() WORDREPL()
WORDSWAP()
Thus, these functions allow to pass the string by reference [@] to
the function so that it may not be necessary to return the transformed
string. By calling CSETREF (.T.), the above mentioned functions return
the value .F. instead of the transformed string if the string is
passed by reference to the function.
The switch is turned off (.F.) by default.
The CTCEXIT() function uninitializes the C part of the CT3 library.
Do not call this function directly.
Examples:
Status:
Ready
Compliance:
CTCEXIT() is a new function in Harbour's CT3 library.
Files:
Source is ctc.c, library is libct.
See also:
CTINIT(),CTEXIT()
CTCINIT()
Lang:
ctc.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctc.txt
Template:
Category:
CT3 general functions
Subcategory:
Oneliner:
Initializes the CT3 library, C part
Syntax:
CTCINIT () -> lInitialized
Arguments:
None
Returns:
lInitialized .T. if the function has been correctly initialized
Description:
The CTCINIT() function initializes the C source part of the CT3
library. Do not call this function directly.
Examples:
Status:
Ready
Compliance:
CTCINIT() is a new function in Harbour's CT3 library.
Files:
Source is ctc.c, library is libct.
See also:
CTINIT(),CTEXIT()
CTEXIT()
Lang:
ct.txt
Component:
hbct
Doc. source:
hbct\doc\en\ct.txt
Template:
Category:
CT3 general functions
Subcategory:
Oneliner:
Uninitializes the CT3 library
Syntax:
CTEXIT () -> nil
Arguments:
none
Returns:
nil
Description:
The CTEXIT() function uninitializes the CT3 library.
Identical code is declared as EXIT FUNCTION, thus should be executed
automatically at the end of the application, but it is a good idea
to call it explicitly somewhere at the end of your program to make
sure that the deinitialization takes place.
Examples:
Status:
Ready
Compliance:
CTEXIT() is a new function in Harbour's CT3 library.
Files:
Source is ct.prg, library is libct.
See also:
CTINIT()
Lang:
ct.txt
Component:
hbct
Doc. source:
hbct\doc\en\ct.txt
Template:
Category:
CT3 general functions
Subcategory:
Oneliner:
Initializes the CT3 library
Syntax:
CTINIT () -> lInitialized
Arguments:
None
Returns:
lInitialized .T. if the function has been correctly initialized
Description:
The CTINIT() function initializes the CT3 library.
Identical code is declared as INIT FUNCTION, thus should be executed
automatically at the beginning of the application, but it is a good
idea to call it once again explicitly somewhere at the beginning of
your program to check the initialization.
Examples:
Status:
Ready
Compliance:
CTINIT() is a new function in Harbour's CT3 library.
Files:
Source is ct.prg, library is libct.
See also:
CTOBIT()
Lang:
numconv.txt
Component:
hbct
Doc. source:
hbct\doc\en\numconv.txt
Template:
Category:
CT3 number and bit manipulation functions
Subcategory:
Oneliner:
Syntax:
CTOBIT (, ) ->
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is numconv.prg, library is libct.
See also:
BITTOC()
CTOD()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Converts a character string to a date expression
Syntax:
CTOD() --> dDate
Arguments:
A character date in format 'mm/dd/yy'
Returns:
A date expression
Description:
This function converts a date that has been entered as a character
expression to a date expression. The character expression will be in
the form "MM/DD/YY" (based on the default value in SET DATE) or in
the appropriate format specified by the SET DATE TO command. If an
improper character string is passed to the function, an empty date
value will be returned.
Examples:
? CToD( "12/21/00" )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
SET DATE,DATE(),DTOS()
CTODOW()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
convert name of day of the week to its ordinal number
Syntax:
CTODOW () -> nOrdinal
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
CTODOW() is compatible with CT3's CTODOW().
Files:
Source is dattime2.prg, library is libct.
See also:
NTOCDOW()
CTOF()
Lang:
ftoc.txt
Component:
hbct
Doc. source:
hbct\doc\en\ftoc.txt
Template:
Category:
CT3 number and bit manipulation functions
Subcategory:
Oneliner:
Syntax:
CTOF( ) --> nFloatingPointNumber
Arguments:
Designate a string that contains a Harbour
number in flotaing point format.
ATTENTION: different implementations or platforms of Harbour, they
could produce different format in the string returned by FTOC().
Returns:
CTOF() return the floating point number that corresponds to the
string passed.
Description:
Character strings created with FTOC() or XTOC() are convert into
Harbour floating point number
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is ftoc.c, library is libct.
See also:
FTOC(), XTOC()
CTOMONTH()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
convert name of month to its ordinal number
Syntax:
CTOMONTH () -> nOrdinal
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
CTOMONTH() is compatible with CT3's CTOMONTH().
Files:
Source is dattime2.prg, library is libct.
See also:
NTOCMONTH()
CTON()
Lang:
numconv.txt
Component:
hbct
Doc. source:
hbct\doc\en\numconv.txt
Template:
Category:
CT3 number and bit manipulation functions
Subcategory:
Oneliner:
Syntax:
CTON ([, ][,]) ->
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is numconv.prg, library is libct.
See also:
NTOC()
CURDIR()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Returns the current OS directory name.
Syntax:
CURDIR( [] ) --> cPath
Arguments:
OS drive letter
Returns:
Name of directory
Description:
This function yields the name of the current OS directory on a
specified drive. If is not specified, the currently logged
drive will be used.
This function should not return the leading and trailing
(back)slashes.
If an error has been detected by the function, or the current OS
directory is the root, the value of the function will be a NULL
byte.
Examples:
? Curdir()
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
FILE()
DATA
Lang:
command.txt
Component:
harbour
Doc. source:
.\doc\en\command.txt
Template:
Command
Category:
Class
Subcategory:
Data
Oneliner:
Alternate syntax for VAR: instance variable for the objects.
Syntax:
DATA [,] [ AS ] [ INIT ]
[[EXPORTED | VISIBLE] | [PROTECTED] | [HIDDEN]] [READONLY | RO]
Arguments:
Name of the DATA
Optional data type specification from the following:
Character, Numeric, Date, Logical, Codeblock, Nil.
Optional initial value when creating a new object.
EXPORTED Specifies that this DATA is accessible to functions and
methods outside of the class. VISIBLE is a synonym for EXPORTED.
PROTECTED Specifies that this DATA is only accessible to functions and methods within this class and its subclasses.
HIDDEN Specifies that this DATA is only accessible to the
class where it was defined, and is not inherited by the
subclasses.
READONLY Restricts assignment to the variable. If specified with
the EXPORTED clause, assignment is only permitted from the current
class and its subclasses. If specified with the PROTECTED clause,
assignment is only permitted from the current class.
RO is a synonym for READONLY.
Returns:
Description:
DATA elements can also be thought of as the "properties" of an
object. They can be of any data type, including codeblock.
Once an object has been created, the DATA elements are referenced
with the colon (:) as in MyObject:Heading := "Last name".
Usually a class also defines methods to manipulate the DATA.
You can use the "AS " clause to enforce that the DATA is
maintained as a certain type. Otherwise it will take on the type of
whatever value is first assigned to it.
Use the "INIT " clause to initialize that DATA to
whenever a new object is created.
VAR can be a synonym for DATA, or it can use a slightly different
syntax for compatibility with other dialects.
Examples:
CREATE CLASS TBColumn
DATA Block // Code block to retrieve data for the column
DATA Cargo // User-definable variable
DATA ColorBlock // Code block that determines color of data items
DATA ColSep // Column separator character
DATA DefColor // Array of numeric indexes into the color table
DATA Footing // Column footing
DATA FootSep // Footing separator character
DATA Heading // Column heading
DATA HeadSep // Heading separator character
DATA Width // Column display width
DATA ColPos // Temporary column position on screen
METHOD New() // Constructor
ENDCLASS
Total number of days from first of Jan to beginning of nMonth.
Syntax:
DAYSTOMONTH (, ) -> nDaysToMonth
Arguments:
Returns:
Description:
lLeap is FALSE for a non-leap year but TRUE if it is. If so and nMonth
is greater than 2, ndays is incremented
TODO: add further documentation
Examples:
Status:
Started
Compliance:
DAYSTOMONTH() is a new function in Harbour's CT3 library.
Files:
Source is dattime2.prg, library is libct.
See also:
DAYSINMONTH()
DBAPPEND()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Appends a new record to a database file.
Syntax:
DbAppend( [] ) --> NIL
Arguments:
Toggle to release record locks
Returns:
DbAppend() always returns NIL
Description:
This function add a new record to the end of the database
in the selected or aliased work area. All fields in that
database will be given empty data values - character fields
will be filled with blank spaces,date fields with CTOD('//'),
numeric fields with 0, logical fields with .F., and memo fields
with NULL bytes. The header of the database is not updated until
the record is flushed from the buffer and the contents are
written to the disk.
Under a networking enviroment, DBAPPEND() performs an additional
operation: It attrmps to lock the newly added record. If
the database file is currently locked or if a locking assignment
if made to LASTREC()+1, NETERR() will return a logical true (.T.)
immediately after the DBAPPEND() function. This function does
not unlock the locked records.
If is passed a logical true (.T.) value, it will
release the record locks, which allows the application to main-
tain multiple record locks during an appending operation. The
default for this parameter is a logical false (.F.).
Examples:
PROCEDURE Main()
LOCAL cName := "HARBOUR", nId := 10
USE test
test->( dbAppend() )
REPLACE test->Name WITH cName, test->Id WITH nId
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBUNLOCK(),DBUNLOCKALL()
DBCLEARFILTER()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Clears the current filter condiction in a work area
Syntax:
DbClearFilTer() --> NIL
Arguments:
Returns:
DbClearFilTer() always returns NIL
Description:
This function clears any active filter condiction
for the current or selected work area.
Examples:
PROCEDURE Main()
USE test
SET FILTER TO Left( test->Name, 2 ) == "An"
dbEdit()
Test->( dbClearFilter() )
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBSETFILTER(),DBFILTER()
DBCLOSEALL()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Close all open files in all work areas.
Syntax:
DbCloseAll() --> NIL
Arguments:
Returns:
DBCLOSEALL() always return NIL
Description:
This function close all open databases and all associated
indexes. In addition, it closes all format files and moves
the work area pointer to the first position
Examples:
PROCEDURE Main()
USE test NEW
dbEdit()
USE test1 NEW
dbEdit()
dbCloseAll()
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBUSEAREA(),DBCLOSEAREA()
DBCLOSEAREA()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Close a database file in a work area.
Syntax:
DbCloseArea()
Arguments:
Returns:
Description:
This function will close any database open in the selected
or aliased work area.
Examples:
PROCEDURE Main()
USE test
dbEdit()
Test->( dbCloseArea() )
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBUSEAREA(),DBCLOSEALL()
DBCOMMIT()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Updates all index and database buffers for a given workarea
Syntax:
DBCOMMIT()
Arguments:
Returns:
Description:
This function updates all of the information for a give,selected,
or active workarea. This operation includes all database and index
buffers for that work area only. This function does not update all
open work areas.
Examples:
PROCEDURE Main()
LOCAL cName := SPACE( 40 )
LOCAL nId := 0
USE test EXCLUSIVE NEW
//
@ 10, 10 GET cName
@ 11, 10 GET nId
READ
//
IF UPDATED()
APPEND BLANK
REPLACE tests->Name WITH cName
REPLACE tests->Id WITH nId
tests->( DBCOMMIT() )
ENDIF
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBCLOSEALL(),DBCOMMITALL(),DBUNLOCK()
DBCOMMITALL()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Flushes the memory buffer and performs a hard-disk write
Syntax:
DBCOMMIT()
Arguments:
Returns:
Description:
This function performs a hard-disk write for all work areas.
Before the disk write is performed,all buffers are flushed.
open work areas.
Examples:
PROCEDURE Main()
LOCAL cName := SPACE( 40 )
LOCAL nId := 0
USE test EXCLUSIVE NEW
USE testid NEW INDEX testid
//
@ 10, 10 GET cName
@ 11, 10 GET nId
READ
//
IF UPDATED()
APPEND BLANK
REPLACE tests->Name WITH cName
REPLACE tests->Id WITH nId
IF ! testid->( DBSEEK( nId ) )
APPEND BLANK
REPLACE tests->Id WITH nId
ENDIF
ENDIF
DBCOMMITALL()
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBCLOSEALL(),DBCOMMIT(),DBUNLOCK()
DBCREATE()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Creates an empty database from a array.
Syntax:
DBCREATE( , , [], [],
[] )
Arguments:
Name of database to be create
Name of a multidimensional array that contains the
database structure
Name of the RDD
3-way toggle to Open the file in New or Current workarea:
NIL The file is not opened.
True It is opened in a New area.
False It is opened in the current area.
Name of database Alias
Returns:
Description:
This function creates the database file specified as from the
multidimensional array . If no file extension is use with
the .dbf extension is assumed.
The array specified in must follow a few guidelines when being
built prior to a call to DBCREATE():
- All subscripts values in the second dimension must be set to proper values
- The fourth subscript value in the second dimension - which contains
the decimal value-must he specified. even 1kw nonnumeric fields.
- The second subscript value in the second dimension-which contains
the field data type-must contain a proper value: C, D, L, M or N
It is possible to use additional letters (or clarity (e.g., 'Numeric'
for 'N'): however, the first letter of this array element must
be a proper value.
The DBCREATE( ) function does not use the decimal field to
calculate the length of a character held longer than 256. Values
up to the maximum length of a character field (which is 65,519 bytes)
are stored directly in the database in the length attribute if that
database was created via this function. However, a file containing
fields longer than 256 bytes is not compatible with any interpreter.
The parameter specifies the name of the Replaceable
Database Driver to use to create the database. If it is not
specified, then the Replaceable Database Driver in the current work
area is used.
The parameter specifies if the already created database is
to be opened, and where. If NIL, the file is not opened. If True,
it is opened in a New area, and if False it is opened in the current
area (closing any file already occupying that area).
The parameter specifies the alias name for the new opened
database.
This function marks a record for deletion in the selected
or aliased work area. If the DELETED setting is on, the record
will still be visible until the record pointer in that work area
is moved to another record.
In a networking situation, this function requires that the record
be locked prior to issuing the DBDELETE() function.
Examples:
nId := 10
USE testid INDEX testid NEW
IF testid->( DBSEEK( nId ) )
IF testid->( RLOCK() )
DBDELETE()
ENDIF
ENDIF
USE
coordinate for top row display. could range from 0
to MAXROW(), default is 0.
coordinate for left column display. could range
from 0 to MAXCOL(), default is 0.
coordinate for bottom row display. could range
from 0 to MAXROW(), default is MAXROW().
coordinate for right column display. could range
from 0 to MAXCOL(), default is MAXCOL().
is an array of character expressions that contain
database fields names or expressions to display in each column.
If not specified, the default is to display all fields from the
database in the current work area.
is a name of a user defined function or a code block
that would be called every time unrecognized key is been pressed or
when there are no keys waiting to be processed and DBEDIT() goes
into idle mode. If is a character string, it must
contain root name of a valid user define function without
parentheses. Both the user define function or the code block should
accept two parameters: nMode, nCurrentColumn. Both should return
a numeric value that correspond to one of the expected return codes
(see table below for a list of nMode and return codes).
is an optional picture. If
is a character string, all columns would used this value as a
picture string. If is an array, each element
should be a character string that correspond to a picture string
for the column with the same index. Look at the help for @...SAY
to get more information about picture values.
contain the header titles for each column, if this
is a character string, all columns would have that same header, if
this is an array, each element is a character string that contain
the header title for one column. Header may be split to more than
one line by placing semicolon (;) in places where you want to break
line. If omitted, the default value for each column header is taken
from or field name if was not specified.
is an array that contain characters that draw
the lines separating the headers and the fields data. Instead of an
array you can use a character string that would be used to display
the same line for all fields. Default value is a double line.
is an array that contain characters that draw
the lines separating displayed columns. Instead of an array you can
use a character string that would be used to display the same line
for all fields. Default value is a single line.
is an array that contain characters that draw
the lines separating the fields data area and the footing area.
Instead of an array you can use a character string that would be
used to display the same line for all footers. Default is to have to
no footing separators.
contain the footing to be displayed at the bottom
of each column, if this is a character string, all columns would
have that same footer, if this is an array, each element is a
character string that contain the footer for one column. Footer may
be split to more than one line by placing semicolon (;) in places
where you want to break line. If omitted, no footer are displayed.
Returns:
DBEDIT() return .F. if there is no database in use or if the number
of columns to display is zero, else DBEDIT() return .T.
Description:
DBEDIT() display and edit records from one or more work areas in
a grid on screen. Each column is defined by element from
and is the equivalent of one field. Each row is equivalent of one
database record.
Following are active keys that handled by DBEDIT():
---------------------------------------------------
Key Meaning
Left Move one column to the left (previous field)
Right Move one column to the right (next field)
Up Move up one row (previous record)
Down Move down one row (next record)
Page-Up Move to the previous screen
Page-Down Move to the next screen
Ctrl Page-Up Move to the top of the file
Ctrl Page-Down Move to the end of the file
Home Move to the leftmost visible column
End Move to the rightmost visible column
Ctrl Left Pan one column to the left
Ctrl Right Pan one column to the right
Ctrl Home Move to the leftmost column
Ctrl End Move to the rightmost column
/table>
When is omitted, two more keys are active:
table>
Key Meaning
Esc Terminate BROWSE()
Enter Terminate BROWSE()
/table>
When DBEDIT() execute it pass the following arguments:
nMode and the index of current record in . If
is omitted, the index number is the FIELD() number of the open
database structure.
DBEDIT() nMode could be one of the following:
---------------------------------------------
Dbedit.ch Meaning
DE_IDLE DBEDIT() is idle, all movement keys have been handled.
DE_HITTOP Attempt to cursor past top of file.
DE_HITBOTTOM Attempt to cursor past bottom of file.
DE_EMPTY No records in work area, database is empty.
DE_EXCEPT Key exception.
The user define function or code block must return a value that tell
DBEDIT() what to do next.
User function return codes:
---------------------------
Dbedit.ch Value Meaning
DE_ABORT 0 Abort DBEDIT().
DE_CONT 1 Continue DBEDIT() as is.
DE_REFRESH 2 Force reread/redisplay of all data rows.
The user function is called once in each of the following cases:
- The database is empty.
- The user try to move past top of file or past bottom file.
- Key exception, the uses had pressed a key that is not handled by DBEDIT().
- The keyboard buffer is empty or a screen refresh had just occurred
DBEDIT() is a compatibility function, it is superseded by the
TBrowse class and there for not recommended for new applications.
Examples:
// Browse a file using default values
USE Test
dbEdit()
Status:
S
Compliance:
can take a code block value, this is a Harbour
extension.
CA-Cl*pper will throw an error if there's no database open, Harbour
would return .F.
CA-Cl*pper is buggy and will throw an error if the number of columns
is zero, Harbour would return .F.
The CA-Cl*pper 5.2 NG state that the return value is NIL, this is
wrong and should be read logical.
There is an undocumented result code (3) from the user defined
function in CA-Cl*pper (both 87 and 5.x). This is an Append Mode which:
"split the screen to allow data to be appended in windowed area".
This mode is not supported by Harbour.
Files:
Header files are dbedit.ch, inkey.ch
Library is rtl
See also:
@...SAY,BROWSE(),TBrowse class,TRANSFORM()
DBEVAL()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Execute and Execution
Oneliner:
Performs a code block operation on the current Database
Syntax:
DBEVAL( ,
[], [],
[], [],
[] ) --> NIL
Arguments:
Operation that is to be performed
Code block for the For condition
Code block for the WHILE condition
Number of NEXT records to process
Record number to work on exactly
Toggle to rewind record pointer
Returns:
DBEVAL() always returns NIL
Description:
Performs a code block operation on the current Database
Examples:
PROCEDURE Main()
LOCAL nCount
USE test
dbGoto( 4 )
? RecNo()
COUNT TO nCount
? RecNo(), nCount
COUNT TO nCount NEXT 10
? RecNo(), nCount
RETURN
Status:
S
Compliance:
C
Files:
Library is rdd
See also:
EVAL()
DBF()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Alias name of a work area
Syntax:
Dbf() -->
Arguments:
Returns:
Name of alias
Description:
This function returns the same alias name ofthe currently selected
work area.
Examples:
PROCEDURE Main()
USE test
SELECT 0
QOut( iif( DBF() == "", "No Name", DBF() ) )
test->( QOut( DBF() ) )
QOut( Alias( 1 ) )
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
ALIAS()
DBFILTER()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Return the filter expression in a work area
Syntax:
DBFILTER() --> cFilter
Arguments:
Returns:
DBFILTER() returns the filter expression.
Description:
This function return the expression of the SET FILTER TO command
for the current or designated work area. If no filter condition
is present, a NULL string will be returned.
Examples:
USE test INDEX test NEW
SET FILTER TO Name == "Harbour"
USE testid INDEX testid NEW
SET FILTER TO Id == 1
SELECT Test
//
? DBFILTER()
? testid->( DBFILTER() )
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBRELATION(),DBRSELECT()
DBGOBOTTOM()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Moves the record pointer to the bottom of the database.
Syntax:
DBGOBOTTOM()
Arguments:
Returns:
Description:
This function moves the record pointer in the selected or aliased
work area to the end of the file. The position of the record pointer
is affected by the values in the index key or by an active FILTER
condition. Otherwise, if no index is active or if no filter condition
is present, the value of the record pointer will be LASTREC().
Examples:
USE tests
DBGOTOP()
? RECNO()
DBGOBOTTOM()
? RECNO()
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
BOF(),EOF(),DBSKIP(),DBSEEK(),DBGOTOP()
DBGOTO()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Position the record pointer to a specific location.
Syntax:
DBGOTO()
Arguments:
Record number or unique identity
Returns:
Description:
This function places the record pointer, if working with a .dbf file,
in selected or aliased work area at the record number specified by
. The position is not affected by an active index or
by any enviromental SET condiction.
The parameter may be something other than a record
number. In some data formats, for example, the value of
is a unique primary key while in other formats, could
be an array offset if the data set was an array.
Issuing a DBGOTO(RECNO()) call in a network enviroment will refresh
the database and index buffers. This is the same as a DBSKIP(0) call.
Examples:
The following example uses DBGOTO() to iteratively process
every fourth record:
DBUSEAREA( .T., "DBFNTX", "sales", "sales", .T. )
//
// toggle every fourth record
DO WHILE ! EOF()
DBGOTO( RECNO() + 4 )
sales->Group := "Bear"
ENDDO
Moves the record pointer to the top of the database.
Syntax:
DBGOTOP()
Arguments:
Returns:
Description:
This function moves the record pointer in the selected or aliased
work area to the top of the file. The position of the record pointer
is affected by the values in the index key or by an active FILTER
condition. Otherwise, if no index is active or if no filter condition
is present, the value of RECNO() will be 1.
Examples:
USE tests
DBGOTOP()
? RECNO()
DBGOBOTTOM()
? RECNO()
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
BOF(),EOF(),DBSKIP(),DBSEEK(),DBGOBOTTOM()
DBRECALL()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Recalls a record previousy marked for deletion.
Syntax:
DBRECALL()
Arguments:
Returns:
Description:
This function unmarks those records marked for deletion and
reactivates them in the aliased or selected work area. If a record
is DELETED and the DELETED setting is on, the record will still be
visible for a DBRECALL() provided that the database record pointer
has not been skipped. Once a record marked for deletion with the
DELETE setting ON has been skipped, it no longer can be brought back
with DBRECALL().
Examples:
USE test NEW
DBGOTO( 10 )
DBDELETE()
? DELETED()
DBRECALL()
? DELETED()
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBDELETE()
DBRLOCK()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
This function locks the record based on identity
Syntax:
DBRLOCK([]) --> lSuccess
Arguments:
Record identifier
Returns:
DBRLOCK() returns a logical true (.T.) if lock was successful
Description:
This function attempts to lock a record which is identified
by in the active data set. If the lock is successful
the function will return a logical true (.T.) value; otherwise
a logical false (.F.) will be returned. If is not
passed it will be assumed to lock the current active record/data
item.
Examples:
PROCEDURE Main()
LOCAL x := 0
USE tests NEW
FOR x := 1 TO reccount()
IF ! DBRLOCK()
DBUNLOCK()
ENDIF
NEXT
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBUNLOCK(),DBUNLOCKALL(),FLOCK(),RLOCK()
DBRLOCKLIST()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
This function return a list of locked records in the database work area
Syntax:
DBRLOCKLIST() --> aRecordLocks
Arguments:
Returns:
is an array of lock records
Description:
This function will return an array of locked records in a given
and active work area. If the return array is an empty array
(meaning no elements in it), then there are no locked records in that
work area.
Examples:
PROCEDURE Main()
LOCAL aList := {}
LOCAL x := 0
USE tests NEW
DBGOTO( 10 )
RLOCK()
DBGOTO( 100 )
RLOCK()
aList := DBRLOCKLIST()
FOR x := 1 TO Len( aList )
? aList[ x ]
NEXT
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
RLOCK(),DBRLOCK(),DBRUNLOCK()
DBRUNLOCK()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Unlocks a record based on its identifier
Syntax:
DBRUNLOCK([])
Arguments:
Record identifier, typically a record number
Returns:
Description:
This function will attempt to unlock the record specified as
, which in a .dbf format is the record number. If not
specified, them the current active record/data item will be
unlocked
Examples:
PROCEDURE Main()
USE tests NEW
DBGOTO( 10 )
IF RLOCK()
? tests->ID
DBRUNLOCK()
ENDIF
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
RLOCK(),DBRLOCK(),DBRLOCKLIST()
DBSEEK()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Searches for a value based on an active index.
Syntax:
DBSEEK(, [],[]) --> lFound
Arguments:
Any expression
Toggle SOFTSEEK condition
is an optional logical value that set the current
record position to the last record if successful
Returns:
DBSEEK() returns logical true (.T.) if found, otherwise false
Description:
This function searches for the first record in a database file whose
index key matches . If the item is found, the function will
return a logical true (.T.), the value of FOUND() wilI be a logical
true (.T.), and the value of EOF() wilI be a logical false (.F.). If
no item is found. then the function will return a logical false, the
value of FOUND( ) will be a logical false (.F.), and the value of
EOF( ) will be a logical true (.T.).
This function always "rewinds" the database pointer and starts the
search from the top of the file.
If the SOFTSEEK flag is on or if is set to a logical true
(.T.) the value of FOUND() will be a logical false and EOF() will be
false if there is an item in the index key with a greater value than
the key expression ; at this point the record pointer will
position itself on that record. However, if there is no greater key
in the index,EOF() will return a logical true (.T.) value. If
is not passed, the function will look to the internal
status of SOFTSEEK before performing the operation. The default of
is a logical false (.F.)
Examples:
PROCEDURE Main()
USE tests NEW INDEX tests
DBGOTO( 10 )
nId := tests->nId
IF tests->( DBSEEK( nId ) )
IF RLOCK()
? tests->Name
DBRUNLOCK()
ENDIF
ENDIF
USE
RETURN
ACCEPT "Employee name: " TO cName
IF Employee->( DBSEEK( cName ) )
Employee->( ViewRecord() )
ELSE
? "Not found"
ENDIF
This function moves the Harbour internal primary focus to the work
area designated by . If is numeric, then it will
select the numeric work area; if is character,then it will
select the work area with the alias name.
DBSELECTAREA(0) will select the next avaliable and unused work area.
Up to 255 work areas are supported. Each work area has its own alias
and record pointer, as well as its own FOUND(), DBFILTER(),
DBRSELECT() and DBRELATION() function values.
Examples:
PROCEDURE Main()
LOCAL nId
USE tests NEW INDEX tests
USE tests1 NEW INDEX tests1
DBSELECTAREA( 1 )
nId := tests->Id
DBSELECTAREA( 2 )
IF DBSEEK( nId )
? tests1->cName
ENDIF
DBCLOSEALL()
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBUSEAREA(),SELECT()
DBSETDRIVER()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Establishes the RDD name for the selected work area
Syntax:
DBSETDRIVER( [] ) --> cCurrentDriver
Arguments:
Optional database driver name
Returns:
DBSETDRIVER() returns the name of active driver
Description:
This function returns the name of the current database driver for the
selected work area. The default will be "DBFNTX". If specified,
contains the name of the database driver that should be
used to activate and manage the work area. If the specified driver is
not avaliable,this function will have no effect.
Examples:
DBSETDRIVER("ADS")
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBUSEAREA()
DBSETFILTER()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Establishes a filter condition for a work area.
Syntax:
DBSETFILTER(, [])
Arguments:
Code block expression for filtered evaluation.
Optional character expression of code block.
Returns:
Description:
This function masks a database so that only those records that meet
the condition prescribed by the expression in the code block
and literally expressed as are visible.
If is not passed to this function,then the DBFILTER()
function will return an empty string showing no filter in that work
area which in fact,would be not correct.
Examples:
PROCEDURE Main()
USE tests NEW
DBSETFILTER( {|| tests->Id <100 }, "tests->Id <100" )
DBGOTOP()
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBFILTER(),DBCLEARFILTER()
DBSKIP()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Moves the record pointer in the selected work area.
Syntax:
DBSKIP([])
Arguments:
Numbers of records to move record pointer.
Returns:
Description:
This function moves the record pointer in the selected or
aliased work area. The default value for will be 1.
A DBSKIP(0) will flush and refresh the internal database bufer and
make any changes made to the record visible without moving the record
pointer in either direction.
Examples:
PROCEDURE Main()
USE tests NEW
DBGOTOP()
DO WHILE ! EOF()
? tests->Id, tests->Name
DBSKIP()
ENDDO
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
BOF(),DBGOBOTTOM(),DBGOTOP(),DBSEEK(),EOF()
dbSkipper()
Lang:
browse.txt
Component:
harbour
Doc. source:
.\doc\en\browse.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Helper function to skip a database
Syntax:
dbSkipper( ) --> nSkipped
Arguments:
is the number of records to skip relative to current record.
Positive number would try to move the record pointer forward, while
a negative number would try to move the record pointer back
records.
Returns:
dbSkipper() return the number of actual record skipped.
Description:
dbSkipper() is a helper function used in browse mechanism to skip
a number of records while giving the caller indication about the
actual records skipped.
Examples:
// open a file and find if we've got enough records in it
USE MonthSales
IF dbSkipper( 100 ) == 100
? "Good work! You can party now"
ELSE
? "Too bad, you should really work harder"
ENDIF
CLOSE
Status:
R
Compliance:
XPP
Files:
Library is rtl
See also:
DBSKIP(),SKIP
DBSTRUCT()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Creates a multidimensional array of a database structure.
Syntax:
DBSTRUCT() --> aStruct
Arguments:
Returns:
DBSTRUCT() returns an array pointer to database structure
Description:
This function returns a multidimensional array. This array has array
pointers to other arrays,each of which contains the characteristic
of a field in the active work area. The lenght of this array is based
in the number of fields in that particular work area. In other words,
LEN(DBSTRUCT()) is equal to the value obtained from FCOUNT().
Each subscript position
Examples:
#include "dbstruct.ch"
PROCEDURE Main()
LOCAL aStru, x
USE tests NEW
aStru := dbStruct()
FOR x := 1 TO LEN( aStru )
? aStru[ x ][ DBS_NAME ]
NEXT
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
Header is dbstruct.ch
See also:
AFIELDS()*
DBUNLOCK()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Unlock a record or release a file lock
Syntax:
DBUNLOCK()
Arguments:
Returns:
Description:
This function releases the file or record lock in the currently
selected or aliased work area. It will not unlock an associated lock
in a related databases.
Examples:
nId := 10
USE testid INDEX testid NEW
IF testid->( DBSEEK( nId ) )
IF testid->( RLOCK() )
DBDELETE()
ELSE
DBUNLOCK()
ENDIF
ENDIF
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBUNLOCKALL(),FLOCK(),RLOCK()
DBUNLOCKALL()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Unlocks all records and releases all file locks in all work areas.
Syntax:
DBUNLOCKALL()
Arguments:
Returns:
Description:
This function will remove all file and record locks in all work area.
Examples:
nId := 10
USE tests INDEX testid NEW
USE tests1 INDEX tests NEW
IF testid->( DBSEEK( nId ) )
IF testid->( RLOCK() )
DBDELETE()
ELSE
DBUNLOCK()
ENDIF
ELSE
DBUNLOCKALL()
ENDIF
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBUNLOCK(),FLOCK(),RLOCK()
DBUSEAREA()
Lang:
rdddb.txt
Component:
harbour
Doc. source:
.\doc\en\rdddb.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Opens a work area and uses a database file.
Syntax:
DBUSEAREA( [], [], , [],
[], [])
Arguments:
A optional logical expression for the new work area
Database driver name
File Name
Alias name
Shared/exclusive status flag
Read-write status flag.
Returns:
Description:
This function opens an existing database named in the current
work area. If is set to a logical true (.T.) value, then
the database will be opened in the next available and unused
work area. The default value of is a logical false (.F.).
If used, is the name of the database driver associated with
the file that is opened. The default for this will be the
value of DBSETDRlVER().
IF used, contains the alias name for that work area, If not
specified, the root name of the database specified in will be
used.
If is set to a logical true (.T.) value, the database that
is specified in will be opened by the user EXCLUSIVELY. Thus
locking it from all other nodes or users on the network. If
is set to a logical false (.F.) value, then the database will be in
SHARED mode. If is not passed, then the function will turn
to the internal setting of SET EXCLUSIVE to determine a setting.
If is specified, the file will be set to READ ONLY mode.
If it is not specified, the file will he opened in normal read-write
mode.
Examples:
DBUSEAREA( .T.,, "tests" )
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBCLOSEAREA(),DBSETDRIVER(),SELECT(),SET()
DECTOBIN()
Lang:
ht_conv.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_conv.txt
Template:
Category:
Conversion Tools
Subcategory:
Oneliner:
Converts a Decimal Value to Binary
Syntax:
DECTOBIN() ->
Arguments:
NUMBER TO BE CONVERTED
Returns:
NUMBER CONVERTED
Description:
This function converts a string from an decimal value
to an binary value.
Examples:
Status:
Compliance:
Files:
Library is libmisc
See also:
Dectohexa(),dectooctal()
DECTOHEXA()
Lang:
ht_conv.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_conv.txt
Template:
Category:
Conversion Tools
Subcategory:
Oneliner:
Converts a Decimal Value to Hexa
Syntax:
DECTOHEXA() ->
Arguments:
NUMBER TO BE CONVERTED
Returns:
NUMBER CONVERTED
Description:
This function converts a string from an decimal value
to an hexadecimal value.
Examples:
Status:
Compliance:
Files:
Library is libmisc
See also:
Dectobin(),dectooctal()
DECTOOCTAL()
Lang:
ht_conv.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_conv.txt
Template:
Category:
Conversion Tools
Subcategory:
Oneliner:
Converts a Decimal Value to Octal
Syntax:
DECTOOCTAL() ->
Arguments:
NUMBER TO BE CONVERTED
Returns:
NUMBER CONVERTED
Description:
This function converts a string from an decimal value
to an octal value.
Examples:
Status:
Compliance:
Files:
Library is libmisc
See also:
Dectohexa(),dectobin()
DELETE FILE
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Command
Category:
Command
Subcategory:
FileSys
Oneliner:
Remove a file from disk
Syntax:
DELETE FILE
Arguments:
Name of file to remove
Returns:
Description:
This command removes a file from the disk. The use of a drive,directo-
ry,and wild-card skeleton operator is allowed for the root of the
filename. The file extension is required. The SET DEFAULT and SET PATH
commands do not affect this command.
The file must be considered closed by the operating system before it
may be deleted.
Examples:
DELETE FILE C:\temp\read.txt
Status:
R
Compliance:
C
Files:
See also:
CURDIR(), FILE(), FERASE(), ERASE
DELETED()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Tests the record's deletion flag.
Syntax:
DELETED() --> lDeleted
Arguments:
(This command has no arguments)
Returns:
DELETED() return a logical true (.T.) or false (.F.).
Description:
This function returns a logical true (.T.) is the current record in the
selected or designated work area ha ben marked for deletion. If not, the
function will return a logical false (.F.).
Examples:
PROCEDURE Main()
USE test NEW
DBGOTO()
DBDELETE()
? "Is Record Deleted", Test->( DELETED() )
DBRECALL()
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBDELETE()
DESCEND()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Conversion
Oneliner:
Inverts an expression of string, logical, date or numeric type.
Syntax:
DESCEND( ) --> xExpInverted
Arguments:
is any valid expression.
Returns:
Inverted value of the same type as passed.
Description:
This function converts an expression in his inverted form. It is
useful to build descending indexes.
Examples:
// Seek for Smith in a descending index
SEEK DESCEND( "SMITH" )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
INDEX, SEEK
DEVOUTPICT()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Procedure
Category:
API
Subcategory:
Terminal
Oneliner:
Displays a value to a device using a picture template
Syntax:
DEVOUTPICT( , , [] )
Arguments:
is any valid expression.
is any picture transformation that TRANSFORM() can use.
is an optional string that specifies a screen color to
use in place of the default color when the output goes to the screen.
Returns:
Description:
Outputs any expression using a picture transformation instead of
using the default transformation for the type of expression.
Examples:
// Output a negative dollar amount using debit notation.
DEVOUTPICT( -1.25, "@D$ 99,999.99 )
Status:
R
Compliance:
DEVOUTPICT() is mostly CA-Cl*pper compliant. Any differences are due
to enhancements in the Harbour TRANSFORM() over CA-Cl*pper.
Files:
Library is rtl
See also:
DEVOUT(),TRANSFORM()
DIR
Lang:
dir.txt
Component:
harbour
Doc. source:
.\doc\en\dir.txt
Template:
Command
Category:
Command
Subcategory:
FileSys
Oneliner:
Display listings of files
Syntax:
DIR []
Arguments:
File mask to include in the function return. It could
contain path and standard wildcard characters as supported by your
OS (like * and ?). If contains no path, then SET DEFAULT
path is used to display files in the mask.
Returns:
Description:
If no is given, __Dir() display information about all
*.dbf in the SET DEFAULT path, this information contain: file name,
number of records, last update date and the size of each file.
If is given, __Dir() list all files that match the mask
with the following details: Name, Extension, Size, Date.
DIR command is preprocessed into __Dir() function during compile
time.
__Dir() is a compatibility function, it is superseded by DIRECTORY()
which returns all the information in a multidimensional array.
Examples:
DIR // information for all DBF files in current directory
dir "*.dbf" // list all DBF file in current directory
// list all PRG files in Harbour Run-Time library
// for DOS compatible operating systems
Dir "C:\harbour\source\rtl\*.prg"
// list all files in the public section on a Unix like machine
Dir "/pub"
Status:
R
Compliance:
C
Files:
See also:
ADIR(),DIRECTORY(),SET DEFAULT,__DIR()*
DIRCHANGE()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Changes the directory
Syntax:
DIRCHANGE( ) --> nError
Arguments:
The name of the directory you want do change into.
Returns:
0 if directory was successfully changed, otherwise
the number of the last error.
Description:
This function attempt to change the current directory to the one
specified in . If this function fails, it will return
the last OS error code number. See FERROR() function for the
description of the error.
Examples:
IF DirChange( "\temp" ) == 0
? "Change to diretory was successfull"
ENDIF
0 if directory was successfully removed, otherwise
the number of the last error.
Description:
This function attempt to remove the specified directory in
If this function fails, it will return the last OS error code number.
See FERROR() function for the description of the error.
Examples:
cDir := ".\backup"
IF DirRemove( cDir ) == 0
? "Remove of directory", cDir, "was successfull"
ENDIF
The number of the drive you are requesting info on where 1 = A,
2 = B, etc. For 0 or no parameter, DiskSpace will operate on the current
drive. The default is 0
Returns:
The number of bytes on the requested disk that match the
requested type.
Description:
By default, this function will return the number of bytes of
free space on the current drive that is available to the user
requesting the information.
If information is requested on a disk that is not available, a runtime
error 2018 will be raised.
Examples:
? "You can use : " + hb_ntos( DiskSpace() ) + " bytes "
Note: See tests\tstdspac.prg for another example
Status:
R
Compliance:
C
Files:
Library is rtl
Header is fileio.ch
See also:
DMY()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
Returns the date as a string in DD Month YY format
Syntax:
DMY ([][, ]) -> cDateString
Arguments:
Returns:
Description:
Returns the date as a string in DD Month YY format. If lmode
is TRUE, a "." is inserted after the DD
TODO: add further documentation
Examples:
Status:
Started
Compliance:
DMY() is compatible with CT3's DMY().
Files:
Source is dattime2.prg, library is libct.
See also:
MDY()
DO()
Lang:
hvm.txt
Component:
harbour
Doc. source:
.\doc\en\hvm.txt
Template:
Function
Category:
API
Subcategory:
Application
Oneliner:
Calls a procedure or a function
Syntax:
DO( [, ] ) -->
Arguments:
= Either a string with a function/procedure name to be called
or a codeblock to evaluate.
= arguments passed to a called function/procedure or to
a codeblock.
Returns:
A value that was returned from called function.
Description:
This function can be called either by the harbour compiler or by user.
The compiler always passes the item of IT_SYMBOL type that stores the
name of procedure specified in DO WITH ... statement.
If called procedure/function doesn't exist then a runtime error
is generated.
This function can be used as replacement of macro operator.
It is also used internally to implement DO WITH
In this case is of type HB_SYMB.
Examples:
cbCode ={|x| MyFunc( x )}
DO( cbCode, 1 )
cFunction := "MyFunc"
xRetVal := DO( cFunction, 2 )
// Old style (slower):
DO &cFunction WITH 3
Status:
Compliance:
C
Files:
Library is rtl
See also:
DOW()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Value for the day of week.
Syntax:
DOW() --> nDay
Arguments:
Any valid date expression
Returns:
The current day number
Description:
This function returns the number representing the day of the week
for the date expressed as .
Examples:
? DOW( Date() )
? DOW( Date() - 6584 )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
DTOC(),CDOW(),DATE(),DTOS(),DAY()
DOY()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
Determines the day of the year for a specific date
Syntax:
DMY ([]) -> nDayOfYear
Arguments:
Returns:
Description:
Determines the day of the year for a specific date
if dDate is invalid, returns 0
TODO: add further documentation
Examples:
Status:
Started
Compliance:
DOY() is compatible with CT3's DOY().
Files:
Source is dattime2.prg, library is libct.
See also:
DOY()
Lang:
dates2.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\dates2.txt
Template:
Category:
Date
Subcategory:
Oneliner:
Gets the day number of the year.
Syntax:
DOY( ) --> nDay
Arguments:
A valid date.
Returns:
The day number
Description:
This function returns the day number of the year for a given date.
This function converts any date expression (a field or variable)
expressed as to a character expression in the default
format "MM/DD/YY". The date format expressed by this function is
controled in part by the date format specified in the SET DATE
command
Examples:
? DToC( Date() )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
SET DATE,DATE(),DTOS()
DTOR()
Lang:
trig.txt
Component:
hbct
Doc. source:
hbct\doc\en\trig.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Convert degree to radiant
Syntax:
DTOR (nDegree) -> nRadiant
Arguments:
the size of that angle in degree
Returns:
the size of an angle in radiant
Description:
The function DTOR() can be used to convert sizes of angles given
in degrees to radiant (as expected by sin, cos or tan functions).
This function returns the value of as a character
string in the format of YYYYMMDD. If the value of is
an empty date, this function will return eight blank spaces.
Examples:
? DToS( Date() )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
DTOC(),DATE(),DTOS()
EJECT
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Procedure
Category:
Command
Subcategory:
Printer
Oneliner:
Issue an command to advance the printer to the top of the form
Syntax:
EJECT
Arguments:
None
Returns:
Description:
This command issue an form-feed command to the printer. If the printer
is not properly hooked up to the computer,an error will not be
generated and the command will be ignored.
Once completed,the values of PROW() and PCOL(),the row and column
indicators to the printer,will be set to 0. Their values,however,may
be manipulated before or after ussuing an EJECT by using the DEVPOS()
function.
On compile time this command is translated into __EJECT() function.
Examples:
Use Clientes New
Set Device to Printer
CurPos:=0
While !Eof()
? Clientes->nome,Clientes->endereco
Curpos++
if Curpos >59
Curpos:=0
Eject
Endif
Enddo
Set Device to Screen
Use
Status:
R
Compliance:
C
Files:
See also:
DEVPOS(),SET PRINTER,PROW(),PCOL()
ELAPTIME()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Calculates elapted time.
Syntax:
ELAPTIME(,) --> cDiference
Arguments:
Start in time as a string format
End time as a string format
Returns:
Difference between the times
Description:
This function returns a string that shows the difference between
the starting time represented as and the ending time
as . If the stating time is greater then the ending
time, the function will assume that the date changed once.
Examples:
STATIC s_cStartTime
INIT PROCEDURE Startup()
s_cStartTime := Time()
RETURN
EXIT PROCEDURE StartExit()
? "You used this program by", ElapTime( s_cStartTime, Time() )
RETURN
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
SECS(),SECONDS(),TIME(),DAY()
EMPTY()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
Checks if the passed argument is empty.
Syntax:
EMPTY( ) --> lIsEmpty
Arguments:
is any valid expression.
Returns:
A logical value. It is true (.T.) if the passed argument is empty
otherwise it is false (.F.).
Description:
This function checks if an expression has empty value and returns a
logical indicating whether it the expression is empty or not.
Examples:
? EMPTY( "I'm not empty" ) // .F.
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
LEN()
ENDCLASS
Lang:
command.txt
Component:
harbour
Doc. source:
.\doc\en\command.txt
Template:
Command
Category:
Class
Subcategory:
Definition
Oneliner:
End the declaration of a class.
Syntax:
ENDCLASS
Arguments:
(This statement has no arguments)
Returns:
Description:
ENDCLASS marks the end of a class declaration.
It is usually followed by the class methods that are not INLINE.
Examples:
CREATE CLASS TWindow
VAR hWnd, nOldProc
ENDCLASS
Status:
R
Compliance:
H
Files:
See also:
Object Oriented Programming,CLASS,METHOD,DATA
ENHANCED()
Lang:
color.txt
Component:
hbct
Doc. source:
hbct\doc\en\color.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Select the "ENHANCED" color value for output
Syntax:
ENHANCED () ->
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
ENHANCED() is compatible with CT3's ENHANCED()
Files:
Source is color.c, library is libct.
See also:
STANDARD(),UNSELECTED()
EOF()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Test for end-of-file condition.
Syntax:
EOF() -->
Arguments:
(This command has no arguments)
Returns:
A logical true (.T.) or false (.F.)
Description:
This function determines if the end-of-file marker has been reached.
If it has, the function will return a logical true (.T.); otherwise
a logical false (.F.) will be returnd
Examples:
PROCEDURE Main()
USE tests NEW
DBGOTOP()
? "Is Eof()", EOF()
DBGOBOTTOM()
? "Is Eof()", EOF()
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
BOF(),FOUND(),LASTREC()
EOM()
Lang:
datetime.txt
Component:
hbct
Doc. source:
hbct\doc\en\datetime.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
_E_nd _O_f _M_onth
Syntax:
EOM ([]) -> dDateEndOfMonth
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
EOM() is compatible with CT3's EOM().
Files:
Source is datetime.prg, library is libct.
See also:
BOM(),BOQ(),EOQ(),BOY(),EOY()
EOM()
Lang:
dates2.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\dates2.txt
Template:
Category:
Date
Subcategory:
Oneliner:
Gets the last day in a month.
Syntax:
EOM( ) --> dEOM
Arguments:
A valid date.
Returns:
The last day in the month.
Description:
This function returns the last day of a given month date.
This command removes a file from the disk. The use of a drive,directo-
ry, and wild-card skeleton operator is allowed for the root of the
filename. The file extension is required. The SET DEFAULT and SET PATH
commands do not affect this command.
The file must be considered closed by the operating system before it
may be deleted.
Examples:
ERASE C:\temp\read.txt
Status:
R
Compliance:
C
Files:
See also:
CURDIR(), FILE(), FERASE(), DELETE FILE
ERROR HANDLER
Lang:
command.txt
Component:
harbour
Doc. source:
.\doc\en\command.txt
Template:
Command
Category:
Class
Subcategory:
Method
Oneliner:
Designate a method as an error handler for the class
Syntax:
ERROR HANDLER ( [] )
Arguments:
Name of the method to define
Optional parameter list
Returns:
Description:
ERROR HANDLER names the method that should handle errors for the
class being defined.
Examples:
CREATE CLASS TWindow
ERROR HANDLER MyErrHandler()
ENDCLASS
ERRORSYS() is called upon startup by Harbour and installs the default
error handler. Normally you should not call this function directly,
instead use ERRORBLOCK() to install your own error handler.
Examples:
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ERRORBLOCK(),Error class
EVAL()
Lang:
eval.txt
Component:
harbour
Doc. source:
.\doc\en\eval.txt
Template:
Function
Category:
API
Subcategory:
Execute and Execution
Oneliner:
Evaluate a code block
Syntax:
EVAL( [, [,...]]) --> xExpression
Arguments:
Code block expression to be evaluated
Argument to be passed to the code block expression
Argument list to be passed to the code block expression
Returns:
The result of the evaluated code block
Description:
This function evaluates the code bloc expressed as and
returns its evaluated value. If their are multiple expressions within
the code block, the last expression will be value of this function.
If the code block requires parameters to be passed to it,they are
specified in the parameter list and following. Each parameter
is separated by a comma within the expression list.
Calculates the value of e raised to the passed power.
Syntax:
EXP( ) -->
Arguments:
Any real number.
Returns:
The anti-logarithm of
Description:
This function returns the value of e raised to the power of
. It is the inverse of LOG().
Examples:
? EXP(45)
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
LOG()
EXPONENT()
Lang:
exponent.txt
Component:
hbct
Doc. source:
hbct\doc\en\exponent.txt
Template:
Category:
CT3 number and bit manipulation functions
Subcategory:
Oneliner:
Evaluate the exponent of a floating point number
Syntax:
EXPONENT( ) --> nExponent
Arguments:
Designate any Harbour number.
Returns:
EXPONENT() returns the exponent of the number
in base 2.
Description:
This function supplements MANTISSA() to return the exponent of the
number.
Values > 1 or values < -1 return a positive number 0 to 1023.
Values < 1 or values > -1 return a negative number -1 to -1023.
The EXPONENT( 0 ), return 0.
The following calculation reproduces the original value:
2^EXPONENT() * MANTISSA() =
TODO: add documentation
Examples:
Status:
Started
Compliance:
EXPONENT() is compatible with CT3's EXPONENT()
Files:
Source is exponent.c, library is libct.
See also:
MANTISSA()
FACT()
Lang:
ctmath2.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctmath2.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Calculates faculty
Syntax:
FACT (nNumber) -> nFaculty
Arguments:
number between 0 and 21
Returns:
the faculty of
Description:
The function FACT() calculates the faculty to the integer given in
. The faculty is defined as n! = 1*2*...*n and is often
used in statistics. Note, that faculties above 21 are too big
so that the function must return a -1.
FAHRENHEIT() converts temperature values measured in the Celsius scale
to the Fahrenheit scale.
Examples:
// melting point of water in standard conditions
? fahrenheit (0.0) --> 32.0
// boiling point of water in standard conditions
? fahrenheit (100.0) --> 212.0
Status:
Ready
Compliance:
FAHRENHEIT() is compatible with CT3's FAHRENHEIT().
Files:
Source is num1.c, library is libct.
See also:
CELSIUS()
FCLOSE()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Closes an open file
Syntax:
FCLOSE( ) -->
Arguments:
DOS file handle
Returns:
Logical TRUE (.T.) or FALSE (.F.)
Description:
This function closes an open file with a dos file handle
of and writes the associated DOS buffer to the
disk. The value is derived from the FCREATE()
or FOPEN() function.
Counts the number of fields in an active database.
Syntax:
FCOUNT() --> nFields
Arguments:
Returns:
Return the number of fields
Description:
This function returns the number of fields in the current or designated
work area. If no database is open in this work area, the function will
return 0.
Examples:
PROCEDURE Main()
USE tests NEW
? "This database have", tests->( FCOUNT() ), "Fields"
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
FIELDNAME(),TYPE()
FCREATE()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Creates a file.
Syntax:
FCREATE( , [] ) --> nHandle
Arguments:
is the name of the file to create.
Numeric code for the file attributes.
Returns:
Numeric file handle to be used in other operations.
Description:
This function creates a new file with a filename of . The
default value of is 0 and is used to set the
attribute byte for the file being created by this function.
The return value will be a file handle that is associated
with the new file. This number will be between zero to 65,535,
inclusive. If an error occurs, the return value of this function
will be -1.
If the file already exists, the existing file will be
truncated to a file length of 0 bytes.
If specified, the following table shows the value for
and their related meaning to the file being created by
this function.
fileio.ch Meaning
0 FC_NORMAL Normal/Default,Read/Write
1 FC_READONLY Read-only file attribute is set
2 FC_HIDDEN Hidden,Excluded from normal DIR search
4 FC_SYSTEM Create,Excluded from normal DIR search
This function deletes the file specified in from the disk.
No extensions are assumed. The drive and path my be included in
; neither the SET DEFAULT not the SET PATH command controls
the performance of this function. If the drive or path is not used,
the function will look for the file only on the currently selected
directory on the logged drive.
If the function is able to successfully delete the file from the
disk, the value of the function will be 0; otherwise a -1 will
be returned. If not successfull, additional information may be
obtained by calling the FERROR() function.
Note: Any file to be removed by FERASE() must still be closed.
Examples:
#include "fileio.ch"
IF FErase( "test.txt" ) != F_ERROR
? "File successfully erased"
ELSE
? "File can not be deleted"
ENDIF
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
FERROR(),FRENAME()
FERROR()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Reports the error status of low-level file functions
Syntax:
FERROR() -->
Arguments:
Returns:
Value of the DOS error last encountered by a
low-level file function.
FERROR() Return Values
Error Meaning
0 Successful
2 File not found
3 Path not found
4 Too many files open
5 Access denied
6 Invalid handle
8 Insufficient memory
15 Invalid drive specified
19 Attempted to write to a write-protected disk
21 Drive not ready
23 Data CRC error
29 Write fault
30 Read fault
32 Sharing violation
33 Lock Violation
Description:
After every low-level file function,this function will return
a value that provides additional information on the status of
the last low-level file functions's performance. If the FERROR()
function returns a 0, no error was detected. Below is a table
of possibles values returned by the FERROR() function.
A valid field name
Additional field name
An valid alias name
Returns:
Description:
This command declares the names of fields (and and
following) with an optional alias identifier as for each.
This command allow Harbour to resolve any reference to a field
specified in the field list by viewing it as a field when it is not
referenced by an alias. If a field is not listed in this list and it
is not explicity tagged with an alias indentifier, it may be viewed
as a memory variable, which may cause run-time errors. This command
has no effect on memory variables or on field reference buried within
a macro expression.
Examples:
PROCEDURE Main()
FIELD Id
FIELD Name
USE tests NEW
Name := "Sales"
Id := 5
USE
RETURN
Status:
R
Compliance:
C
Files:
None.
See also:
MEMVAR,PRIVATE,PUBLIC,STATIC
FIELDBLOCK()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
RDD
Oneliner:
Return a code block that sets/gets a value for a given field
Syntax:
FIELDBLOCK( ) --> bFieldBlock
Arguments:
is a string that contain the field name.
Returns:
FIELDBLOCK() return a code block that when evaluate could retrieve
a field value or assigning a new value to the field. If
is not specified or from type other than character, FIELDBLOCK()
return NIL.
Description:
FIELDBLOCK() return a code block that sets/gets the value of field.
When this code block is evaluated without any parameters passed then
it returns the current value of the given field. If the code block
is evaluated with a parameter, than its value is used to set a new
value to the field, this value is also return by the block. If the
block is evaluate and there is no field with the name
in the current work area, the code block return NIL.
Note that FIELDBLOCK() works on the current work area, if you need
a specific work area code block use FIELDWBLOCK() instead.
Examples:
// open a file named Test that have a field named "name"
LOCAL bField
bFiled := FIELDBLOCK( "name" )
USE Test
? "Original value of field 'name' :", EVAL( bField )
EVAL( bField, "Mr X new name" )
? "New value for the field 'name' :", EVAL( bField )
Status:
R
Compliance:
If the block is evaluate and there is no field with the name
in the current work area, the code block return NIL.
CA-Cl*pper would raise BASE/1003 error if the field does not exist.
Files:
Library is rtl
See also:
EVAL(),FIELDWBLOCK(),MEMVARBLOCK()
FIELDDECI()
Lang:
ht_dbf.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_dbf.txt
Template:
Category:
Database tools
Subcategory:
Oneliner:
Determines the number of decimal places of a given numeric field.
Syntax:
FIELDDECI() --> nFieldDeci
Arguments:
Numeric data field , for which number of decimal
places need to be determined.
Returns:
FIELDDECI() returns the numeric value that designates the number
of decimal places of a given field.
Description:
This function determines the number of decimal places of a given numeric field.
Examples:
FUNCTION Main()
LOCAL i
USE Tests NEW
FOR i = 1 TO FCOUNT()
? FieldDeci( i )
NEXT
USE
RETURN NIL
xed>
Status:
R
Compliance:
This function is CA-Cl*pper tools compatible
Files:
Library is libmisc
See also:
FIELDTYPE(),FIELDSIZE()
FIELDGET()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Obtains the value of a specified field
Syntax:
FIELDGET() --> ValueField
Arguments:
Is the numeric field position
Returns:
Any expression
Description:
This function returns the value of the field at the th location
in the selected or designed work area. If the value in does not
correspond to n avaliable field position in this work area, the function
will return a NIL data type.
Examples:
PROCEDURE Main()
USE test NEW
? test->( FieldGet( 1 ) )
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
FIELDPUT()
FIELDNAME()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Return the name of a field at a numeric field location.
Syntax:
FIELDNAME/FIELD() --> cFieldName
Arguments:
Field order in the database.
Returns:
returns the field name.
Description:
This function return the name of the field at the th position.
If the numeric value passed to this function does not correspond to an
existing field in the designated or selected work area, this function
will return a NULL byte.
Examples:
PROCEDURE Main()
LOCAL x
USE tests NEW
FOR x := 1 TO tests->( FCOUNT() )
? "Field Name", FieldName( x )
NEXT
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DBSTRUCT(),FCOUNT(),LEN(),VALTYPE()
FIELDPOS()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Return the ordinal position of a field.
Syntax:
FIELDPOS() --> nFieldPos
Arguments:
Name of a field.
Returns:
is ordinal position of the field.
Description:
This function return the ordinal position of the specified field
in the current or aliased work areaIf there isn't field under the name
of or of no database is open in the selected work area, the func-
tion will return a 0.
Examples:
PROCEDURE Main()
USE test NEW
? test->( FIELDPOS( "ID" ) )
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
FIELDGET(),FIELDPUT()
FIELDPUT()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Set the value of a field variable
Syntax:
FIELDPUT(, ) --> ValueAssigned
Arguments:
The field numeric position
Expression to be assigned to the specified field
Returns:
Any expression
Description:
This function assings the value in to the th
field in the current or designated work area. If the operation is
successful, the return value of the function will be the same value
assigned to the specified field. If the operation is not successful,
the function will return a NIL data type
Examples:
USE tests NEW
FIELDPUT( 1, "Mr. Jones" )
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
FIELDGET()
FIELDSIZE()
Lang:
ht_dbf.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_dbf.txt
Template:
Category:
Database tools
Subcategory:
Oneliner:
Determines the size of a given field.
Syntax:
FIELDSIZE() --> nFieldSize
Arguments:
Data field , which size need to be determined.
Returns:
FIELDSIZE() returns the number that designates the size of a given
field.
Description:
This function determines the size of a field, designated by its number.
Examples:
FUNCTION Main()
LOCAL i
USE Tests NEW
FOR i = 1 TO FCOUNT()
? FieldSize( i )
NEXT
USE
RETURN NIL
xed>
Status:
R
Compliance:
This function is CA-Cl*pper tools compatible
Files:
Library is libmisc
See also:
FIELDTYPE(),FIELDDECI()
FIELDTYPE()
Lang:
ht_dbf.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_dbf.txt
Template:
Category:
Database Tools
Subcategory:
Oneliner:
Determines the type of a given field.
Syntax:
FIELDTYPE() --> cFieldType
Arguments:
Data field , which type need to be determined.
Returns:
FIELDTYPE() returns the character that designates the type of
a given field:
This function determines the type of a field, designated by its
number.
Examples:
FUNCTION Main()
LOCAL i
USE Tests NEW
FOR i = 1 TO FCOUNT()
? FieldType( i )
NEXT
USE
RETURN NIL
Status:
R
Compliance:
This function is CA-Cl*pper tools compatible
Files:
Library is libmisc
See also:
FIELDSIZE(),FIELDDECI()
FIELDWBLOCK()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
RDD
Oneliner:
Return a sets/gets code block for field in a given work area
Syntax:
FIELDWBLOCK( , ) --> bFieldBlock
Arguments:
is a string that contain the field name.
is the work area number in which exist.
Returns:
FIELDWBLOCK() return a code block that when evaluate could retrieve
field value or assigning a new value for a field in a given work
area. If is not specified or from type other than
character, or if is not specified or is not numeric
FIELDWBLOCK() return NIL.
Description:
FIELDWBLOCK() return a code block that sets/gets the value of field
from a given work area. When this code block is evaluated without
any parameters passed then it returns the current value of the given
field. If the code block is evaluated with a parameter, than its
value is used to set a new value to the field, this value is also
return by the block. If the block is evaluate and there is no field
with the name in work area number , the code
block return NIL.
Examples:
LOCAL bField
// this block work on the field "name" that exist on work area 2
bFiled := FIELDBLOCK( "name", 2 )
// open a file named One in work area 1
// that have a field named "name"
SELECT 1
USE one
// open a file named Two in work area 2
// it also have a field named "name"
SELECT 2
USE two
SELECT 1
? "Original names: ", One->name, Two->name
? "Name value for file Two :", EVAL( bField )
EVAL( bField, "Two has new name" )
? "and now: ", One->name, Two->name
Status:
R
Compliance:
If the block is evaluate and there is no field with the name
in the given work area, the code block return NIL.
CA-Cl*pper would raise BASE/1003 error if the field does not exist.
Files:
Library is rtl
See also:
EVAL(),FIELDBLOCK(),MEMVARBLOCK()
FILE()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Tests for the existence of file(s)
Syntax:
FILE( ) --> lExists
Arguments:
Dos Skeleton or file name to find.
Returns:
a logical true (.T.) if the file exists or logical
false (.F.).
Description:
This function return a logical true (.T.) if the given filename
exist.
Dos skeletons symbols may be used in the filename in ,
as may the drive and/or path name. If a path is not explicitly
specified, FILE() will look for the file in the SET DEFAULT path,
then in each SET PATH path, until the file is found or there are
no more paths to search. The DOS PATH is never searched and the
current drive/directory is only searched if SET DEFAULT is blank.
A true (.T.) value, if the lock was successful;otherwise
false (.F.)
Description:
This function returns a logical true (.T.) if a file lock is
attempted and is successfully placed on the current or designated
database. This function will also unlock all records locks placed
by the same network station.
Examples:
USE tests New
IF FLOCK()
SUM tests->Ammount
ENDIF
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
RLOCK()
FLOOR()
Lang:
ctmath2.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctmath2.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Rounds down a number to the next integer
Syntax:
FLOOR (nNumber) -> nDownRoundedNumber
Arguments:
number to round down
Returns:
the rounded number
Description:
The function FLOOR() determines the biggest integer that is smaller
than .
Examples:
? floor (1.1) --> 1.0
? floor (-1.1) --> -2.0
Status:
Ready
Compliance:
FLOOR() is compatible with CT3's FLOOR().
Files:
Source is math.c, library is libct.
See also:
CEILING
FOPEN()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Open a file.
Syntax:
FOPEN( , [] ) --> nHandle
Arguments:
Name of file to open.
Dos file open mode.
Returns:
A file handle.
Description:
This function opens a file expressed as and returns a
file handle to be used with other low-level file functions. The
value of represents the status of the file to be opened;
the default value is 0. The file open modes are as follows:
nMode fileio.ch Meaning
0 FO_READ Read only
1 FO_WRITE Write only
2 FO_READWRITE Read/write
16 FO_EXCLUSIVE Exclusive read only
32 FO_DENYWRITE Prevent others from writing
48 FO_DENYREAD Deny read only
64 FO_DENYNONE Not deny, Let to others Read / Write
64 FO_SHARED same as FO_DENYNONE
If there is an error in opening a file, a -1 will be returned by
the function. Files handles may be in the range of 0 to 65535. The
status of the SET DEFAULT TO and SET PATH TO commands has no effect
on this function. Directory names and paths must be specified along
with the file that is to be opened.
If an error has occurred, see the returns values from FERROR() for
possible reasons for the error.
Examples:
#include "fileio.ch"
IF ( nH := FOpen( "x.txt", 66 ) ) == F_ERROR
? "File can't be opened"
ENDIF
Status:
R
Compliance:
C
Files:
Library is rtl
Header is fileio.ch
See also:
FCREATE(),FERROR(),FCLOSE()
FOUND()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Determine the success of a previous search operation.
Syntax:
FOUND() --> lSuccess
Arguments:
(This function has no arguments)
Returns:
A logical true (.T.) is successful; otherwise, false (.F.)
Description:
This function is used to test if the previous SEEK, LOCATE, CONTINUE,
or FIND operation was successful. Each wrk area has its own FOUND()
flag, so that a FOUND() condition may be tested in unselected work
areas by using an alias.
Examples:
nId := 100
USE tests NEW INDEX tests
SEEK nId
IF FOUND()
? tests->Name
ENDIF
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
EOF()
FREAD()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Reads a specified number of bytes from a file.
Syntax:
FREAD( , @, ) --> nBytes
Arguments:
Dos file handle
Character expression passed by reference.
Number of bytes to read.
Returns:
the number of bytes successfully read from the file.
Description:
This function reads the characters from a file whose file handle
is into a character memory variable expressed as .
The function returns the number of bytes successfully read into
.
The value of is obtained from either a call to the FOPEN()
or the FCREATE() function.
The expression is passed by reference and must be defined
before this function is called. It also must be at least the same
length as .
is the number of bytes to read, starting at the current
file pointer position. If this function is successful in reading
the characters from the file, the length of or the number
of bytes specified in will be the value returned. The current
file pointer advances the number of bytes read with each successive
read. The return value is the number of bytes successfully read
from the file. If a 0 is returned, or if the number of
bytes read matches neither the length of nor the specified
value in an end-of-file condition has been reached.
This function returns a character string of bytes from a
file whose DOS file handle is .
The value of the file handle is obtained from either the
FOPEN() or FCREATE() functions.
The value of is the number of bytes to read from the file.
The returned string will be the number of characters specified in
or the number of bytes read before an end-of-file charac-
ter (ASCII 26) is found.
NOTE This function is similar to the FREAD() function, except that
it will not read binary characters that may he required as part of
a header of a file construct. Characters Such as CHR(0) and CHR(26)
may keep this function from performing its intended operation. In this
event, the FREAD() function should he used in place of the FREADSTR()
function.
If successful, a 0 will be returned otherwise,
a -1 will be returned.
Description:
This function renames the specified file to .
A filename and/or directory name may be specified for either para-
meter. However, if a path is supplied as part of and
this path is different from either the path specified in
or (if none is used) the current drive and directory, the function
will not execute successfully.
Neither parameter is subject to the control of the SET PATH TO or
SET DEFAULT TO commands. In attempting to locate the file to be
renamed, this function will search the default drive and directory
or the drive and path specified in . It will not search
directories named by the SET PATH TO and SET DEFAULT TO commands
or by the DOS PATH statement.
If the file specified in exists or the file is open,
the function will be unable to rename the file. If the function
is unable to complete its operation,it will return a value of -1.
If it is able to rename the file, the return value for the function
will be 0. A call to FERROR() function will give additional infor-
mation about any error found.
Examples:
#include "fileio.ch"
nResult := FRename( "x.txt", "x1.txt" )
IF nResult == F_ERROR
? "File could not be renamed."
ENDIF
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ERASE,FERASE(),FERROR(),FILE(),RENAME
FSEEK()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Positions the file pointer in a file.
Syntax:
FSEEK( , , [] ) --> nPosition
Arguments:
DOS file handle.
The number of bytes to move.
The relative position in the file.
Returns:
the current position relative to begin-of-file
Description:
This function sets the file pointer in the file whose DOS file
handle is and moves the file pointer by bytes
from the file position designated by . The returned value
is the relative position of the file pointer to the beginning-of-file
marker once the operation has been completed.
is the file handle number. It is obtained from the FOPEN()
or FCREATE() function.
The value of is the number of bytes to move the file pointer
from the position determined by . The value of may
be a negative number, suggesting backward movement.
The value of designates the starting point from which the
file pointer should he moved, as shown in the following table:
fileio.ch File position
0 FS_SET Beginning of file
1 FS_RELATIVE Current file pointer position
2 FS_END End of file
If a value is not provided for , it defaults to 0 and
moves the file pointer from the beginning of the file.
Examples:
// here is a function that read one text line from an open file
// nH = file handle obtained from FOpen()
// cB = a string buffer passed-by-reference to hold the result
// nMaxLine = maximum number of bytes to read
FUNCTION FREADln( nH, cB, nMaxLine )
LOCAL cLine, nSavePos, nEol, nNumRead
cLine := Space( nMaxLine )
cB := ""
nSavePos := FSeek( nH, 0, FS_RELATIVE )
nNumRead := FRead( nH, @cLine, nMaxLine )
IF ( nEol := At( hb_eol(), SubStr( cLine, 1, nNumRead ) ) ) == 0
cB := cLine
ELSE
cB := SubStr( cLine, 1, nEol - 1 )
FSEEK( nH, nSavePos + nEol + 1, FS_SET )
ENDIF
RETURN nNumRead != 0
FTOC() return a string with the size of DOUBLE.
ATTENTION: different implementations or platforms of Harbour, they
could produce different format in the string returned by FTOC().
Description:
Harbour internal numbers in Floating Point are stored in data type
DOUBLE. FTOC() returns these bits as an string. In this way,
numbers con be saved more compactly.
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is ftoc.c, library is libct.
See also:
CTOF(), XTOC()
FT_AADDITION()
Lang:
aading.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\aading.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Add elements unique of source array to target array
Syntax:
FT_AADDITION( , [, [, ] ] ) ;
-> aNewArray
Arguments:
is the primary array.
is the secondary array.
is a logical value denoting whether leading or
trailing spaces should be included in the
comparison. If .T., then ignores spaces in
comparison, defaults to .T., .F. includes spaces.
is a logical value denoting case sensitivity.
If .T., then comparison is sensitive to case,
defaults to .T., .F. ignores case.
Returns:
An array of the union of aList1 and aList2.
Description:
This function will add the elements unique of aList2 with aList1.
It returns a new array including all the elements of aList1
plus the unique elements of aList2.
Examples:
aList1 := {"apple", "orange", "pear"}
aList2 := {"apple ", "banana", "PEAR"}
FT_AADDITION( aList1, aList2 )
// ignores spaces, sensitive to case
// returns {"apple","orange","pear","banana","PEAR"}
FT_AADDITION( aList1, aList2, , .F. )
// ignores spaces, not sensitive to case
// returns {"apple","orange","pear","banana"}
FT_AADDITION( aList1, aList2, .F., .F. )
// sensitive to spaces, not sensitive to case
// returns {"apple","orange","pear","apple ","banana"}
Status:
Compliance:
Files:
See also:
FT_AAVG()
Lang:
aavg.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\aavg.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Average numeric values in an array
Syntax:
FT_AAVG( [, [, ] ] ) -> nAverage
Arguments:
is the array containing the elements to be averaged.
is the first array item to include,
defaults to first element.
is the last array element to include,
defaults to all elements.
Returns:
The average of the specified array elements.
Description:
This function is used to get a numeric average of selected or all
elements of an array.
This routine requires FT_ASUM().
Examples:
FT_AAVG(aSubTotals) // Get Average of Entire Array
FT_AAVG(aSubTotals, 5) // Get Average of 5th Element On
FT_AAVG(aSubTotals, , 10) // Get Average of 1st 10 Elements
FT_AAVG(aSubTotals, 5, 10) // Get Average of Elements 5-10
Status:
Compliance:
Files:
See also:
FT_ACCTADJ()
Lang:
acctadj.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\acctadj.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Adjust beginning or ending fiscal pd. dates to acctg. dates
Syntax:
FT_ACCTADJ( [ ], [ ] ) -> dDate
Arguments:
is any valid date in any valid format.
Defaults to DATE() if not supplied.
is a logical variable. .F. = adjust for beginning of
period mode, .T. = adjust for end of period mode. Defaults to
beginning of period mode.
Returns:
An adjusted date dependent upon mode and work week start day.
Description:
Called by other FT_ACCT.. functions. The algorithm is:
Beginning of period mode:
If dGivenDate is in last 3 days of work week
Return next week's start date
Else
Return this week's start date
Endif
End of period mode:
If dGivenDate is in last 4 days of work week
Return this week's end date
Else
Return prior week's end date
Endif
Examples:
Beginning of period mode (lIsEnd == .F.)
dDate := Ctod( "01/31/91" ) // In last 3 days of work week
? FT_ACCTADJ( dDate ) // 02/03/91 (next week's start)
dDate := Ctod( "03/31/91" ) // Not in last 3 days of work week
? FT_ACCTADJ( dDate ) // 03/31/91 (this week's start)
End of period mode (lIsEnd == .T.)
dDate := Ctod( "01/31/91" ) // In last 4 days of work week
? FT_ACCTADJ( dDate, .T. ) // 02/02/91 (this week's end)
dDate := Ctod( "03/31/91" ) // Not in last 4 days of work week
? FT_ACCTADJ( dDate, .T. ) // 03/30/91 (prior week's end)
Status:
Compliance:
Files:
See also:
FT_DATECNFG() FT_DAYTOBOW()
FT_ACCTMONTH()
Lang:
acctmnth.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\acctmnth.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Return accounting month data
Syntax:
FT_ACCTMONTH( [ ], [ ] ) -> aDateInfo
Arguments:
is any valid date in any date format. Defaults
to current system date if not supplied.
is a number from 1 to 12 signifying a month.
Defaults to current month if not supplied.
Returns:
A three element array containing the following data:
aDateInfo[1] - The year and month as a character string "YYYYMM"
aDateInfo[2] - The beginning date of the accounting month
aDateInfo[3] - The ending date of the accounting month
Description:
FT_ACCTMONTH() creates an array containing data about the
accounting month containing the given date.
An accounting period has the following characteristics:
If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.
If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.
Examples:
// get info about accounting month containing 9/15/90
aDateInfo := FT_ACCTMONTH( Ctod("09/15/90") )
? aDateInfo[1] // 199009 (9th month)
? aDateInfo[2] // 09/02/90 beginning of month 9
? aDateInfo[3] // 09/29/90 end of month 9
// get info about accounting month 5 in year containing 9/15/90
aDateInfo := FT_ACCTMONTH( Ctod("09/15/90"), 5 )
? aDateInfo[1] // 199005
? aDateInfo[2] // 04/29/89 beginning of month 5
? aDateInfo[3] // 06/02/90 end of month 5
is any valid date in any date format. Defaults
to current system date if not supplied.
is a number from 1 to 4 signifying a quarter.
Defaults to current quarter if not supplied.
Returns:
A three element array containing the following data:
aDateInfo[1] - The year and qtr. as a character string "YYYYQQ"
aDateInfo[2] - The beginning date of the accounting quarter
aDateInfo[3] - The ending date of the accounting quarter
Description:
FT_ACCTQTR() creates an array containing data about the
accounting quarter containing the given date.
An accounting period has the following characteristics:
If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.
If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.
Examples:
// get info about accounting month containing 9/15/90
aDateInfo := FT_ACCTQTR( CTOD("09/15/90") )
? aDateInfo[1] // 199003 (3rd quarter)
? aDateInfo[2] // 07/01/90 beginning of quarter 3
? aDateInfo[3] // 09/29/90 end of quarter 3
// get info about accounting qtr. 2 in year containing 9/15/90
aDateInfo := FT_ACCTQTR( CTOD("09/15/90"), 2 )
? aDateInfo[1] // 199002
? aDateInfo[2] // 04/01/89 beginning of quarter 2
? aDateInfo[3] // 06/30/90 end of quarter 2
is any valid date in any date format. Defaults
to current system date if not supplied.
is a number from 1 to 52 signifying a week.
Defaults to current week if not supplied.
Returns:
A three element array containing the following data:
aDateInfo[1] - The year and week as a character string "YYYYWW"
aDateInfo[2] - The beginning date of the accounting week
aDateInfo[3] - The ending date of the accounting week
Description:
FT_ACCTWEEK() returns an array containing data about the
accounting week containing the given date.
An accounting period has the following characteristics:
If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.
If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.
Examples:
// get info about accounting week containing 9/15/90
aDateInfo := FT_ACCTWEEK( CTOD("09/15/90") )
? aDateInfo[1] // 199037 (37th week)
? aDateInfo[2] // 09/09/90 beginning of week 37
? aDateInfo[3] // 09/15/90 end of week 37
// get info about accounting week 25 in year containing 9/15/90
aDateInfo := FT_ACCTWEEK( CTOD("09/15/90"), 25 )
? aDateInfo[1] // 199025
? aDateInfo[2] // 06/17/89 beginning of week 25
? aDateInfo[3] // 06/23/90 end of week 25
is any valid date in any date format. Defaults
to current system date if not supplied.
Returns:
A three element array containing the following data:
aDateInfo[1] - The year as a character string "YYYY"
aDateInfo[2] - The beginning date of the accounting year
aDateInfo[3] - The ending date of the accounting year
Description:
FT_ACCTYEAR() creates an array containing data about the
accounting year containing the given date.
An accounting period has the following characteristics:
If the first week of the period contains 4 or more 'work'
days, it is included in the period; otherwise, the first
week was included in the prior period.
If the last week of the period contains 4 or more 'work'
days it is included in the period; otherwise, the last week
is included in the next period. This results in 13 week
'quarters' and 4 or 5 week 'months'. Every 5 or 6 years, a
'quarter' will contain 14 weeks and the year will contain 53
weeks.
Examples:
// get info about accounting year containing 9/15/90
aDateInfo := FT_ACCTYEAR( CTOD("09/15/90") )
? aDateInfo[1] // 1990
? aDateInfo[2] // 12/31/89 beginning of year
? aDateInfo[3] // 12/29/90 end of year
NIL .... but optionally places Total of calculation in active
Get variable using oGet:VARPUT()
Description:
PopAdder() gives you an adding machine inside your Clipper 5.2
application. It has the basic functions add, subtract, multiply,
and divide. You may move it from one side of the screen to the
other. It even displays a scrollable tape, if you want it.
There are a few HOT Keys while using the Adder:
ecimals - change # of decimals
ove - the Adder from right display to left
ape - turn the Tape Display On or Off
croll - the tape display
---+-- 1st Clear entry
+-- 2nd Clear ADDER
- Quit
- return a to the active get
A couple of notes about the adder:
1.) It was designed to be used on an Enhanced keyboard with
separate key. is used to clear the adder.
However, it will still work on a Standard keyboard.
2.) You do not have to display the tape. You may turn it on
at any time by pressing . You may SCROLL back through
the tape once there are more than 16 entries in the
adder, by pressing .
3.) To Quit the Adder just press . To return your Total
to the application press . The adder will place the
Total in the active GET variable using oGet:VarPut(). The
adder will only return a Total to a numerical GET!
4.) There are many support functions that you might find
interesting. They are part of my personal library, but
are necessary to the operation of the adder.
You might want to pull these out to reduce the overall
size of the adder. Many are worth at least a little
time studying.
5.) To make FT_Adder a Hot key from inside your application
at the beginning of your application add the line:
SET KEY K_ALT_A TO FT_Adder
This will make a key "Hot" and permit you to
Pop - Up the adder from anywhere in the application.
6.) If you use FT_INKEY(), you can even have active hotkeys
in an INKEY().
Examples:
Status:
Compliance:
Files:
See also:
FT_ADDWKDY()
Lang:
wda.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\wda.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Return true number of days to add given number of workdays
Syntax:
FT_ADDWKDY( , ) -> nTrueDays
Arguments:
= date to start adding from
= number of workdays to add
Returns:
= Number of actual days to add to in
order to add the required
Description:
Let's say you are given the problem:
"All invoices are due 10 working days from the date they
are printed. Please display the due date on the invoice."
When is the due date? Assuming you are printing the invoices
today, your answer is:
dDueDate := DATE() + ft_addWkDay( DATE(), 10 )
A work day is defined as Monday through Friday. Unfortunately
this routine does _not_ account for holidays.
This documentation was written by Glenn Scott so if it's wrong,
blame him.
Examples:
// Postdate 5 working days from the first of January
dPost := CTOD("01/01/91")
dPost += FT_ADDWKDY( dPost, 5 ) // returns 7 true days
? dPost // 01/08/91
Status:
Compliance:
Files:
See also:
FT_WORKDAYS()
FT_ADESSORT()
Lang:
adessort.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\adessort.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Sort an array in descending order
Syntax:
FT_ADESSORT( [, [, ] ] ) -> aSorted
Arguments:
is the array to be sorted
is the first array item to include in the sort,
defaults to first element
is the last array element to include in the sort,
defaults to all elements
Returns:
The array, sorted in descending order.
Description:
This function is used to sort an array in descending order, i.e., Z-A
Examples:
FT_ADESSORT(aNames) // Sort the Entire Array
FT_ADESSORT(aNames, 5) // Sort from the 5th Element On
FT_ADESSORT(aNames, , 10) // Sort the 1st 10 Elements
FT_ADESSORT(aNames, 5, 10) // Sort Elements 5-10
Status:
Compliance:
Files:
See also:
FT_AEMAXLEN()
Lang:
aemaxlen.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\aemaxlen.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Find longest element within an array
Syntax:
FT_AEMAXLEN( [, [, [, ] ] ] ) ;
-> nMaxlen
Arguments:
is the array containing the elements to be measured.
is the array dimension to be measured,
defaults to first dimension.
is the starting array element to include,
defaults to first array element.
is the number of array elements to process from
from , defaults to remaining elements
in array.
Returns:
The length of the longest size element of an array.
Description:
This function will measure each element of an array
dimension and return the longest element.
Examples:
FT_AEMAXLEN(aArray) // Measure the 1st dimension of an Array
FT_AEMAXLEN(aArray,2) // Measure the 2nd dimension of an Array
FT_AEMAXLEN(aArray,2,,9) // Measure Elements 1-9 of the
2nd dimension or subarray
FT_AEMAXLEN(aArray,3,5,9) // Measure Elements 5-9 of the
3rd dimension or subarray
FT_AEMAXLEN(aArray,3,5) // Measure Elements 5 to last in the
3rd dimension or subarray
Status:
Compliance:
Files:
See also:
FT_AEMINLEN()
FT_AEMINLEN()
Lang:
aeminlen.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\aeminlen.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Find shortest element within an array
Syntax:
FT_AEMINLEN( [, [, [, ] ] ] )
-> nMinlen
Arguments:
is the array containing the elements to be measured.
is the array dimension to be measured,
defaults to first dimension.
is the starting array element to include,
defaults to first array element.
is the number of array elements to process from
from , defaults to remaining elements
in array.
Returns:
The length of the shortest size element of an array.
Description:
This function will measure each element of an array
dimension and return the shortest element.
Examples:
FT_AEMINLEN(aArray) // Measure the 1st dimension of an Array
FT_AEMINLEN(aArray,2) // Measure the 2nd dimension of an Array
FT_AEMINLEN(aArray,2,,9) // Measure Elements 1-9 of 2nd dimension
FT_AEMINLEN(aArray,3,5,9) // Measure Elements 5-9 of 3rd dimension
FT_AEMINLEN(aArray,3,5) // Measure Elements 5 to end of 3rd dimension
Status:
Compliance:
Files:
See also:
FT_AEMAXLEN()
FT_ALT()
Lang:
alt.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\alt.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Determine status of the Alt key
Syntax:
FT_ALT() -> lValue
Arguments:
None
Returns:
.T. if Alt key is pressed, .F. if otherwise.
Description:
This function is useful for times you need to know whether or not the
Alt key is pressed, such as during a MemoEdit().
Examples:
IF FT_ALT()
@24, 0 say "Alt"
ELSE
@24, 0 say " "
ENDIF
Find middle value in array, or average of two middle values
Syntax:
FT_AMEDIAN( [, [, ] ] )
-> nMedian
Arguments:
is the array containing the elements to be averaged.
is the first array element to include,
defaults to first element.
is the last array element to include,
defaults to last element.
Returns:
The median average of the array elements
Description:
This function sorts the elements of a numeric array and
then returns the value in the middle element of the sorted
array. If there is no exact middle value, then it returns
the average of the two middle values. Half of the elements
are > median and half are < median. A median average may
more reflect a more useful average when there are extreme
values in the set.
Examples:
FT_AMEDIAN( aArray ) // Return Median for entire array
FT_AMEDIAN( aArray, 2) // Return Median for elements from 2 to end
FT_AMEDIAN( aArray, ,9) // Return Median for 1st 9 elements
FT_AMEDIAN( aArray,8,40 ) // Return Median for elements 8 to 40
Status:
Compliance:
Files:
See also:
FT_ANOMATCHES()
Lang:
anomatch.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\anomatch.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Find the number of array elements meeting a condition
Syntax:
FT_ANOMATCHES( , ;
[, [, ] ] ) -> nNoOfMatches
Arguments:
is the array to be searched
is a code block containing the expression for
the array elements to be tested with. Each element is passed
as a parameter to the block. If the block returns .T., the
number of matches will be incremented by one.
is the first array item to include in the search,
defaults to first element.
is the last array element to include in the search,
defaults to all elements.
Returns:
The number of elements that cause the code block to return .T.
Description:
This function returns the number of array elements that, when passed
to the supplied code block, cause that code block to return a .T. value.
Examples:
// Search the Entire Array
FT_ANOMATCHES(aTries, { | x | x <= 100 } )
// Search from the 5th Element On
FT_ANOMATCHES(aCodes, { | x | UPPER(x) == cCurrentCode }, 5)
// Search the 1st 10 Elements
FT_ANOMATCHES(aDates, { | x | IS_BETWEEN(DATE()-7,x,DATE() + 7) }, 10)
// Search Elements 5-10
FT_ANOMATCHES(aNames, { | x | x <= cLastGoodName }, 5, 10)
Status:
Compliance:
Files:
See also:
FT_AREDIT()
Lang:
aredit.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\aredit.txt
Template:
Category:
Array
Subcategory:
Oneliner:
2 dimensional array editing function using TBrowse
Syntax:
FT_AREDIT( , , , , , ;
, , [, ] ) -> xElement
Arguments:
, , , are coordinates for TBrowse
is name of 2 dimensional to array edit
is pointer for element in array
is array of column headings
is array of blocks describing each array element
[ ] is get editing function for handling individual elements
Returns:
Value of element positioned on when exit FT_AREDIT()
The type of this value depends on what is displayed.
Description:
This function allows you to position yourself in an array,
add and delete rows with the and keys,
and pass a UDF with information to edit the individual gets.
Examples:
FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks)
This example will allow you to browse a 2 dimensional array
But you can't edit it since there is no GetBlock UDF
It allows the user to hit ENTER to select an element or ESC to
return 0
* This second example shows how to edit a 2 dimensional array
* as might be done to edit an invoice
LOCAL i, ar[3, 26], aBlocks[3], aHeadings[3]
LOCAL nElem := 1, bGetFunc
* Set up two dimensional array "ar"
FOR i = 1 TO 26
ar[1, i] := i // 1 -> 26 Numeric
ar[2, i] := CHR(i+64) // "A" -> "Z" Character
ar[3, i] := CHR(91-i) // "Z" -> "A" Character
NEXT i
* SET UP aHeadings Array for column headings
aHeadings := { "Numbers", "Letters", "Reverse" }
* Need to set up individual array blocks for each TBrowse column
aBlocks[1] := {|| STR(ar[1, nElem], 2) } // prevent default 10 spaces
aBlocks[2] := {|| ar[2, nElem] }
aBlocks[3] := {|| ar[3, nElem] }
* set up TestGet() as the passed Get Function so FT_ArEdit knows how
* to edit the individual gets.
bGetFunc := { | b, ar, nDim, nElem | TestGet(b, ar, nDim, nElem) }
SetColor( "N/W, W/N, , , W/N" )
CLEAR SCREEN
FT_AREDIT(3, 5, 18, 75, ar, @nElem, aHeadings, aBlocks, bGetFunc)
Status:
Compliance:
Files:
See also:
FT_ASUM()
Lang:
asum.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\asum.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Sum the elements of an array
Syntax:
FT_ASUM( [, [, ] ] ) -> nSum
Arguments:
is the array containing the elements to be summed.
is the first array item to include,
defaults to first element.
is the last array element to include,
defaults to all elements.
Returns:
The sum of the elements of the array or the lengths of the elements.
Description:
This function is to sum the elements of a numeric array or to sum the
lengths of a character array.
Examples:
FT_ASUM(aSubTotals) // Sum the Entire Array
FT_ASUM(aSubTotals, 5) // Sum from the 5th Element On
FT_ASUM(aSubTotals, , 10) // Sum the 1st 10 Elements
FT_ASUM(aSubTotals, 5, 10) // Sum Elements 5-10
Status:
Compliance:
Files:
See also:
FT_AT2()
Lang:
at2.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\at2.txt
Template:
Category:
String
Subcategory:
Oneliner:
Find position of the nth occurrence of a substring
Syntax:
FT_AT2( , [, [, ] ] ) -> nPos
Arguments:
is the character substring to search for.
is the character string to search.
is the occurrence of cSearch to look for,
defaults to 1.
is a logical value denoting case sensitivity.
If .F., then search is NOT sensitive to case,
defaults to .T.
Returns:
The position of the nth occurrence of a substring
Description:
This function will find the nth occurrence of a substring
within a string.
Examples:
cSearch := "t"
cTarget := "This is the day that the Lord has made."
FT_AT2( cSearch, cTarget ) // Returns ( 9 )
FT_AT2( cSearch, cTarget, 2 ) // Returns ( 17 )
FT_AT2( cSearch, cTarget, 2, .F. ) // Returns ( 9 )
Status:
Compliance:
Files:
See also:
FT_FINDITH(), FT_RAT2()
FT_BITCLR()
Lang:
bitclr.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\bitclr.txt
Template:
Category:
String
Subcategory:
Oneliner:
Clear (reset) selected bit in a byte
Syntax:
FT_BITCLR( , ) -> cByte
Arguments:
is a character from CHR(0) to CHR(255).
is a number from 0 to 7 conforming to standard
right-to-left bit numbering convention and representing the
position of the bit within the byte.
Returns:
Returns new byte, with designated bit cleared (reset).
If parameters are faulty, returns NIL.
Description:
In effect, ANDs argument byte with a byte that has all bits set except
the target bit. If bit is already clear (0), it remains clear.
Note: Calls FT_ISBIT() which is also in this Library.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
This code would clear bit 4 in a byte represented by CHR(115):
cNewByte := FT_BITCLR( CHR(115), 4 )
? ASC( cNewbyte ) // result: 99
? cNewByte // result: 'c'
This code would clear bit 5 in the byte represented by letter 'A':
FT_BITCLR( 'A', 5 ) // result: 'A', since
// bit 5 already clear
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
Status:
Compliance:
Files:
See also:
FT_BITSET() FT_ISBIT()
FT_BITSET()
Lang:
bitset.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\bitset.txt
Template:
Category:
String
Subcategory:
Oneliner:
Set selected bit in a byte
Syntax:
FT_BITSET( , ) -> cByte
Arguments:
is a character from CHR(0) to CHR(255).
is a number from 0 to 7 conforming to standard right-to-left
bit numbering convention and representing the position of the bit
within the byte.
Returns:
Returns new byte, with designated bit set. If parameters are faulty,
returns NIL.
Description:
In effect, ORs argument byte with a byte that has only the target bit
set. If bit is already set, it remains set.
Note: Calls FT_ISBIT() which is also in this Library.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
This code would set bit 4 in a byte represented by CHR(107):
cNewbyte := FT_BITSET( CHR(107), 4 )
? ASC( cNewbyte ) // result: 123
? cNewbyte // result: '{'
This code would set bit 5 in the byte represented by the letter 'A'.
? FT_BITSET( 'A', 5 ) // result: 'a'
// bit 5 set
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
Status:
Compliance:
Files:
See also:
FT_BITCLR() FT_ISBIT()
FT_BLINK()
Lang:
blink.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\blink.txt
Template:
Category:
Menus/Prompts
Subcategory:
Oneliner:
Display a blinking message on the screen
Syntax:
FT_BLINK( , [ ], [ ] ) -> NIL
Arguments:
is the string to blink.
is an optional screen row for @...SAY, default current.
is an optional screen col for @...say, default current.
Returns:
NIL
Description:
A quick way to blink a msg on screen in the CURRENT colors.
Restores colors on return.
Examples:
FT_BLINK( "WAIT", 5, 10 ) // Blinks "WAIT" in current colors @ 5,10
@5,10 SAY "WAIT - Printing Report"
FT_BLINK( "..." ) // Blink "..." after wait message...
Status:
Compliance:
Files:
See also:
FT_BRWSWHL()
Lang:
tbwhile.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\tbwhile.txt
Template:
Category:
Menus/Prompts
Subcategory:
Oneliner:
Browse an indexed database limited to a while condition
is array of field blocks of fields you want to display.
Example to set up last name and first name in array:
aFields := {}
AADD(aFields, {"Last Name" , {||Names->Last} } )
AADD(aFields, {"First Name", {||Names->First} } )
is the limiting WHILE condition as a block.
Example 1: { ||Names->Last == "JONES" }
Example 2: { ||Names->Last == "JONES" .AND. Names->First == "A" }
is the key to find top condition of WHILE.
cLast := "JONES "
cFirst := "A"
Example 1: cKey := cLast
Example 2: cKey := cLast + cFirst
is number of fields to freeze in TBrowse. Defaults
to 0 if not passed.
is a logical indicating whether or not you want to
save the screen from the calling program. Defaults to .T. if
not passed.
is a list of colors for the TBrowse columns.
The 1st color is used as SAY/TBrowse Background and the
3rd and 4th colors are used as part of column:defColor := {3, 4}
Thus if you pass a cColorList, you MUST pass at least 4 colors.
Defaults to "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R" if not passed.
is the color of the TBrowse box shadow. Defaults
to "N/N" if not passed.
, , , are the coordinates of
the area to display the TBrowse in. Defaults to 2, 2,
MAXROW() - 2, MAXCOL() - 2 with shadowed box, i.e. full screen.
Returns:
nRecno is the number of the record selected by the key.
0 is returned if there are either no records matching the WHILE
condition or an is pressed instead of an
Description:
This is a demonstration of TBrowse with a WHILE condition for an
indexed database.
Examples:
* This example will only show those people with last name of "JONES"
* in the TBNames.dbf which contains at least the fields:
* Last, First, City AND is indexed on Last + First.
LOCAL nRecSel := 0
LOCAL aFields := {}
LOCAL bWhile := {||TBNames->Last = "JONES"}
LOCAL cKey := "JONES"
LOCAL nFreeze := 1
LOCAL lSaveScrn := .t.
LOCAL cColorList := "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R"
LOCAL cColorShad := "N/N"
USE TBNames INDEX TBNames NEW // indexed on Last + First
* Pass Heading as character and Field as Block including Alias
* To eliminate the need to use FIELDWBLOCK() function in FT_BRWSWHL()
AADD(aFields, {"Last Name" , {||TBNames->Last} } )
AADD(aFields, {"First Name", {||TBNames->First} } )
AADD(aFields, {"City" , {||TBNames->City} } )
IF FT_BRWSWHL( aFields, bWhile, cKey, nFreeze, lSaveScrn, ;
cColorList, cColorShad, 3, 6, MaxRow() - 2, MaxCol() - 6) == 0
? "Sorry, NO Records Were Selected"
ELSE
? "You Selected: " + TBNames->Last +" "+ ;
TBNames->First +" "+ TBNames->City
ENDIF
Status:
Compliance:
Files:
See also:
FT_BYT2BIT()
Lang:
byt2bit.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\byt2bit.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Convert byte to string of 1's and 0's
Syntax:
FT_BYT2BIT( ) -> cBitPattern
Arguments:
is the byte to convert.
Returns:
9-character string, consisting of 1's and 0's, representing bits 0
through 7 of parameter byte, with space between bits 3 and 4. Returns
NIL if parameters are faulty.
Description:
Can be used to show results of bit manipulation, both before and after.
Binary representation follows right-to-left convention of bit position
numbering, 0 through 7. Space between high and low nibbles for clarity
and easy comparison to hexadecimal notation.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
These three code lines perform a bitwise AND on bytes with values of
CHR(20) and CHR(36), and deliver the result as a string in binary (bit)
format.
? FT_BYT2BIT(CHR(20)) // byte1: '0001 0100'
? FT_BYT2BIT(CHR(36)) // byte2: '0010 0100'
? FT_BYT2BIT(FT_BYTEAND(CHR(20), CHR(36)))
// result: '0000 0100'
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
Status:
Compliance:
Files:
See also:
FT_BYT2HEX()
FT_BYT2HEX()
Lang:
byt2hex.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\byt2hex.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Convert byte to hexadecimal version of its binary value
Syntax:
FT_BYT2HEX( cByte ) -> cHexValue
Arguments:
is the byte to convert.
Returns:
Three-character string, consisting of two digits of hexadecimal
notation and letter 'h' to signify hex. Returns NIL if parameters are
faulty.
Description:
Can be used to show results of bit manipulation, both before and after.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
These three code lines perform a bitwise AND on bytes with values of
CHR(20) and CHR(36), and deliver the result as a string in hexadecimal
format, using 'h' to signify hexadecimal.
? FT_BYT2HEX(CHR(20)) // byte1: '14h'
? FT_BYT2HEX(CHR(36)) // byte2: '24h'
? FT_BYT2HEX(FT_BYTEAND(CHR(20), CHR(36)))
// result: '04h'
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
Status:
Compliance:
Files:
See also:
FT_BYT2BIT()
FT_BYTEAND()
Lang:
byteand.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\byteand.txt
Template:
Category:
String
Subcategory:
Oneliner:
Perform bit-wise AND on two ASCII characters (bytes)
Syntax:
FT_BYTEAND( , ) -> cByte
Arguments:
and are characters from CHR(0) TO CHR(255).
May be passed in CHR() form, as character literals, or as expressions
evaluating to CHR() values.
Returns:
Returns resulting byte, in CHR() form. If parameters are faulty,
returns NIL.
Description:
Can be used for any bit-wise masking operation. In effect, this is a
bit-by-bit AND operation. Equivalent to AND assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
This code would mask out the high nibble (four most significant bits)
of the byte represented by chr(123) and leave the low nibble bits as in
the parameter byte.
cNewbyte := FT_BYTEAND( CHR(123), CHR(15) )
? asc(cNewByte) // result: 11
? cNewByte // result: non-printable character
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
is a character from CHR(0) to CHR(255).
May be passed in CHR() form, as character literal, or
as expression evaluating to CHR() value.
Returns:
Returns resulting byte, in CHR() form. If parameters are faulty,
returns NIL.
Description:
Can be used for bit-wise byte manipulation. In effect, this is a
bit-by-bit NEG (two's complement) operation. Equivalent to NEG
assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
This code performs a bit-wise NEG on byte represented by CHR(32):
cNewByte := FT_BYTENOT(CHR(32))
? asc(cNewByte) // result: 224
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
is a character from CHR(0) to CHR(255).
May be passed in CHR() form, as character literal, or
as expression evaluating to CHR() value.
Returns:
Returns resulting byte, in CHR() form. If parameters are faulty,
returns NIL.
Description:
Can be used for bitwise byte manipulation. In effect, this is a
bit-by-bit NOT (one's complement) operation. Equivalent to the
NOT assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
This code performs a bitwise NOT on byte represented by CHR(32):
cNewByte := FT_BYTENOT( CHR(32) )
? ASC( cNewByte ) // result: 223
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
Perform bit-wise OR on two ASCII characters (bytes)
Syntax:
FT_BYTEOR( , ) -> cNewByte
Arguments:
and are characters from CHR(0) TO CHR(255).
May be passed in CHR() form, as character literals, or as
expressions evaluating to CHR() values.
Returns:
Returns resulting byte, in CHR() form. If parameters are faulty,
returns NIL.
Description:
Can be used for bit-wise byte manipulation. In effect, this is a
bit-by-bit OR operation. Equivalent to OR assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
This code performs a bit-wise OR on two bytes represented
by CHR(20) and CHR(10):
cNewByte := FT_BYTEOR( CHR(20), CHR(10) )
? ASC( cNewByte ) // result: 30
? cNewByte // result: non-printable character
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
Perform bit-wise XOR on two ASCII characters (bytes)
Syntax:
FT_BYTEXOR( , ) -> cNewByte
Arguments:
and are characters from CHR(0) to CHR(255).
May be passed in CHR() form, as character literals, or
as expressions evaluating to CHR() values.
Returns:
Returns resulting byte, in CHR() form. If parameters are faulty,
returns NIL.
Description:
Can be used for bit-wise byte manipulation. In effect, this is a
bit-by-bit XOR operation. Equivalent to XOR assembler instruction.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
This code performs a bit-wise XOR on two bytes represented
by CHR(32) and CHR(55):
cNewByte := FT_BYTEXOR( CHR(32), CHR(55) )
? ASC( cNewByte ) // result: 23
? cNewByte // result: non-printable character
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
is an optional screen row for calendar display,
default row 1.
is an optional screen col for calendar display,
default col 63.
is an optional color string for displayed messages,
default is bright white text over green background.
is an optional logical variable. If true (.T.),
it uses FT_SHADOW() to add a transparent shadow
to the display, default (.F.).
is an optional logical variable. If true, uses
FT_XBOX to display a four line help message
if the F1 key is pressed, default (.F.).
Returns:
aRetVal is an 8 element array containing date, month, day, year,
month (in character format), day of the week, julian day
and current time.
Description:
FT_CALENDAR() simply displays today's date, time and julian
day in a two line display with an optional box shadow. Cursor keys may
be used to page through the calendar by day, week, month or year
increments. Returns an 8 element array of calendar data:
Element Value
[1] Date in current date format.
[2] Numeric month number.
[3] Numeric day number.
[4] Numeric year number.
[5] Month in character format.
[6] Day of the week in character format.
[7] Numeric Julian day.
[8] Current time in time format.
WARNING: FT_CALENDAR uses FT_SHADOW and FT_XBOX
from the Nanforum Toolkit!
0 if successful
3 if path not found
99 if invalid parameters passed
Description:
Use this function if you prefer to change the active directory
instead of relying on the SET PATH command.
The source code is written to adhere to Turbo Assembler's IDEAL mode.
To use another assembler, you will need to rearrange the PROC and
SEGMENT directives, and also the ENDP and ENDS directives (a very
minor task).
Convert usual civilian format time to military time.
Syntax:
FT_CIV2MIL( ) -> cMILTIME
Arguments:
character string of form hh:mm (am,pm,n or m),
where 0
Returns:
character string of form hhmm, where 0<=hh<24.
Description:
Converts time from 12-hour civilian format to military.
Examples:
FT_CIV2MIL( " 5:40 pm" ) -> 1740
FT_CIV2MIL( " 5:40 am" ) -> 0540
FT_CIV2MIL( "12:00 n" ) -> 1200
FT_CIV2MIL( "12:00 m" ) -> 0000
Caution: leading blanks are irrelevant; p,a,n,m must be preceded by
one and only one space.
is an array of subarrays, with each subarray containing
information about the colour settings.
The subarray has the following structure:
[1] cName is the name of this colour setting i.e. "Pick List"
Maximum length is 20 bytes
[2] cClrStr is the current colour string
Default is "W/N,N/W,N/N,N/N,N/W"
If Setting type is "M" (Menu) the colours are...
1. Prompt Colour
2. Message Colour
3. HotKey Colour
4. LightBar Colour
5. LightBar HotKey Colour
Note: While there are many ways to code the individual
colour combinations, they should be in the same
format that gets returned from SETCOLOR(), so
the defaults can be found in the colour palette.
foreground [+] / background [*]
i.e. "GR+/BG*, N/W*, N+/N, , W/N"
[3] cType is the type of colour setting
Default is "W" (Window)
T = Title Only 1 colour element
D = Desktop Background colour and character
M = Menu For FT_Menuto() style menus
W = Window Windows with radio buttons
G = Get For use with @ SAY...
B = Browse For tBrowse() and *dbEdit()
A = aChoice Pick-lists etc...
W/G/B/A are functionally the same but will provide
a more appropriate test display.
[4] cFillChar is the character (for desktop background only)
Default is CHR(177) "±±±±±±±±±±±±±±"
.T. use colour palette
.F. use monochrome palette
Default is the ISCOLOR() setting
2 Byte character string for colour test display
Default is the CHR(254)+CHR(254) "þþ"
Returns:
An array identical to the one passed, with new selected colours
Description:
This function allows users to select their own colour combinations
for all the different types of screen I/O in a typical application.
This facilitates an easy implementation of Ted Means' replacement
of the @..PROMPT/MENU TO found in the NanForum Toolkit. If you are
not using FT_MENUTO(), you can specify "A" for setting type and have
a normal colour string returned.
Examples:
LOCAL aClrs := {}
LOCAL lColour := ISCOLOR()
LOCAL cChr := CHR(254) + CHR(254)
SET SCOREBOARD Off
SETBLINK( .F. ) // Allow bright backgrounds
*.... a typical application might have the following different settings
* normally these would be stored in a .dbf/.dbv
aClrs := {;
{ "Desktop", "N/BG", "D", "±" }, ;
{ "Title", "N/W", "T" }, ;
{ "Top Menu", "N/BG,N/W,W+/BG,W+/N,GR+/N", "M" }, ;
{ "Sub Menu", "W+/N*,GR+/N*,GR+/N*,W+/R,G+/R","M" }, ;
{ "Standard Gets", "W/B, W+/N,,, W/N", "G" }, ;
{ "Nested Gets", "N/BG, W+/N,,, W/N", "G" }, ;
{ "Help", "N/G, W+/N,,, W/N", "W" }, ;
{ "Error Messages", "W+/R*,N/GR*,,,N/R*", "W" }, ;
{ "Database Query", "N/BG, N/GR*,,,N+/BG", "B" }, ;
{ "Pick List", "N/GR*,W+/B,,, BG/GR*", "A" } ;
}
aClrs := FT_ClrSel( aClrs, lColour, cChr )
Status:
Compliance:
Files:
See also:
FT_COLOR2N()
Lang:
color2n.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\color2n.txt
Template:
Category:
String
Subcategory:
Oneliner:
Returns the numeric complement of a Clipper color string
Syntax:
FT_COLOR2N( ) -> nValue
Arguments:
is a Clipper color string
Returns:
The numeric complement of a color string or 0 if passed color
is invalid.
Description:
This function is useful when calling other functions that expect
a numeric color parameter. It is often more convenient to pass
a converted color string than having to calculate or look up the
corresponding number.
is a character date string in the user's system date
format, i.e., the same as the user would enter for CTOD(). If
this argument is NIL, the current value is unchanged.
Note: The year portion of the date string must be present and
be a valid year; however, it has no real meaning.
is a number from 1 to 7 (1 = Sunday) indicating the
desired start of a work week. If this argument is NIL,
the current value is unchanged.
Returns:
A 2-element array containing the following information:
aDateInfo[1] - an ANSI date string indicating the beginning
date of the year. Only the month and day are
meaningful.
aDateInfo[2] - the number of the first day of the week
(1 = Sunday)
Description:
FT_DATECNFG() is called internally by many of the date functions
in the library to determine the beginning of year date and
beginning of week day.
The default beginning of the year is January 1st and the default
beginning of the week is Sunday (day 1). Either or both of these
settings may be changed by calling FT_DATECNFG() with the proper
arguments. They will retain their values for the duration of the
program or until they are changed again by a subsequent call to
FT_DATECNFG().
It is not necessary to call FT_DATECNFG() unless you need to
change the defaults.
FT_DATECNFG() affects the following library functions:
FT_WEEK() FT_ACCTWEEK() FT_DAYTOBOW()
FT_MONTH() FT_ACCTMONTH() FT_DAYOFYR()
FT_QTR() FT_ACCTQTR() FT_ACCTADJ()
FT_YEAR() FT_ACCTYEAR()
Examples:
// Configure library date functions to begin year on
// July 1st.
FT_DATECNFG("07/01/80") // year is insignificant
// Examples of return values:
// System date format: American aArray[1] aArray[2]
aArray := FT_DATECNFG() // '1980.01.01' 1 (Sun.)
aArray := FT_DATECNFG('07/01/80') // '1980.07.01' 1 (Sun.)
aArray := FT_DATECNFG('07/01/80', 2) // '1980.07.01' 2 (Mon.)
aArray := FT_DATECNFG( , 2 ) // '1980.01.01' 2 (Mon.)
// System date format: British
aArray := FT_DATECNFG('01/07/80', 2) // '1980.07.01' 2 (Mon.)
Status:
Compliance:
Files:
See also:
FT_ACCTADJ()
FT_DAYOFYR()
Lang:
dayofyr.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\dayofyr.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Return calendar, fiscal or accounting day data
Syntax:
FT_DAYOFYR( [ ], [ ], [ ] )
-> aDateInfo
Arguments:
is any valid date in any valid format. Defaults
to current system date if not supplied.
is a number from 1 to 371, signifying a day of a year.
Defaults to current day if not supplied.
is a logical which specifies the type of year to base
the return value on: .F. = calendar or fiscal year,
.T. = accounting year.
Returns:
A three element array containing the following data:
If is specified:
aDateInfo[1] - The date of the specified day number
aDateInfo[2] - The beginning date of the year
aDateInfo[3] - The ending date of the year
If is not specified:
aDateInfo[1] - The year and day as a character string "YYYYDDD"
aDateInfo[2] - The beginning date of the year
aDateInfo[3] - The ending date of the year
Description:
FT_DAYOFYR() returns an array containing data about a day in the
calendar or fiscal year containing the given date.
The beginning of year date defaults to January 1st but may be
changed with FT_DATECNFG().
Examples:
aDateInfo := FT_DAYOFYR( CTOD("03/31/91") )
? aDateInfo[1] // 1991090 (90th day of year 1991)
? aDateInfo[2] // 01/01/91
? aDateInfo[3] // 12/31/91
aDateInfo := FT_DAYOFYR( , 90 ) // assume current date is 3/31/91
? aDateInfo[1] // 03/31/91 (90th day of year)
? aDateInfo[2] // 01/01/91
? aDateInfo[3] // 12/31/91
aDateInfo := FT_DAYOFYR( , 90, .T. )
? aDateInfo[1] // 03/29/91 (90th day of accounting year)
? aDateInfo[2] // 12/30/90 (1st day of accounting year)
? aDateInfo[3] // 12/28/91 (last day of accounting year)
Status:
Compliance:
Files:
See also:
FT_DATECNFG()
FT_DAYTOBOW()
Lang:
daytobow.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\daytobow.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Calculate no. of days between date and beginning of week
Syntax:
FT_DAYTOBOW( [ ] ) -> nDays
Arguments:
is any valid date in any valid date format.
Defaults to current date if not supplied.
Returns:
A positive number of days to beginning of week, range 0 to 6.
Description:
FT_DAYTOBOW() returns the number of days to the beginning of the
week. Normally this will be one less than the value that
would be returned by the Clipper function DOW(), unless the
day for the beginning of the week has been changed with
FT_DATECNFG().
- text file to display (full path and filename)
- upper row of window
- left col of window
- lower row of window
- right col of window
- line to place highlight at startup
- normal text color (numeric attribute)
- text highlight color (numeric attribute)
- terminating key list (each byte of string is a
key code)
- act-like-a-browse-routine flag
- col increment for left/right arrows
- right margin - anything to right is truncated
- size of the paging buffer
Returns:
0 if successful, FError() code if not
Description:
Note: make sure you allocate a buffer large enough to hold enough
data for the number of lines that you have in the window. Use the
following formula as a guideline:
buffer size = (# of line) + 1 * RMargin
This is the smallest you should make the buffer. For normal use,
4096 bytes is recommended
This routine displays a text file within a defined window using as
little memory as possible. The text file to display has to be
present or an error value of 0 is returned (as a character.)
Assumptions: The routine assumes that all lines are terminated
with a CR/LF sequence (0x0d and 0x0a).
Note: Make sure you allocate a buffer large enough to hold
enough data for the number of lines that you have
in the window. Use the following formula as a
guideline - buffer size = (# of line) + 1 * RMargin
this is the smallest you should make the buffer and
for normal use I recommend 4096 bytes.
Cursor Keys: Up, Down - moves the highlight line
Left, Right - moves the window over nColSkip col's
Home - moves the window to the far left
End - moves the window to the nRMargin column
PgUp, PgDn - moves the highlight one page
Ctrl-PgUp - moves the highlight to the file top
Ctrl-PgDn - moves the highlight to the file bottom
Ctrl-Right - moves the window 16 col's to the right
Ctrl-Left - moves the window 16 col's to the left
Esc, Return - terminates the function
All other keys are ignored unless they are specified
within cExitKeys parameter. This list will tell the
routine what keys terminate the function. Special
keys must be passed by a unique value and that value
can be found by looking in the keys.h file.
is a multidimensional array of messages to be
displayed and the color attributes for each message.
The first dimension of the array contains one or more elements,
each representing one line in the message box, up to the maximum
number of rows on the screen.
Within each line of the message individual characters or groups
of characters may be delimited with braces ([]). The braces will
be stripped out and the character(s) inside those braces will be
highlighted.
The second dimension of the array contains a color attribute for
the corresponding element in dimension one, plus one additional
element for the color of the box border. Dimension two will
always contain one more element than dimension one. If an
attribute is omitted, the last color selected will be used.
is a character string of one or more keys to check
for. If omitted, the message is displayed and control is returned
to the calling procedure. If one character is specified,
FT_DISPMSG() waits for one keypress, restores the screen and
returns. If multiple characters are specified, FT_DISPMSG()
remains in a loop until one of the specified keys has been
pressed, then restores the screen and returns.
is the upper row for the message box. If omitted, the
box is centered vertically.
is the leftmost column for the box. If omitted, the
box is centered horizontally.
is a string of characters or a variable for the box
border. See the DISPBOX() function. If omitted, a double box is
drawn.
is a logical variable. If true (.T.) or omitted, it
uses FT_SHADOW() to add a transparent shadow to the box. If
false (.F.), the box is drawn without the shadow.
Returns:
If is not specified, FT_DISPMSG() will return false
(.F.).
If is a one-character string, FT_DISPMSG() will return
true (.T.) if the user presses that key, or false (.F.) if any
other key is pressed.
If consists of multiple characters, it will lock the
user in a loop until one of those keys are pressed and return the
INKEY() value of the keypress.
Description:
FT_DISPMSG() is a multi-purpose pop-up for user messages.
Multiple lines may be displayed, each with a different attribute.
The box will be automatically centered on the screen, or the row
and/or column can be specified by the programmer. It also centers
each line of the message within the box.
Examples:
The following example displays a simple two-line message
and returns immediately to the calling routine.
FT_DISPMSG( { { "Printing Report" , ;
"Press [ESC] To Interrupt" } , ;
{ "W+/B*", "W/B", "GR+/B" } } )
The next example displays a message and waits for a key press.
FT_DISPMSG( { { "Press [D] To Confirm Deletion" , ;
"Or Any Other Key To Abort" } , ;
{ "W+/B", "W+/B", "GR+/B" } } , ;
"D" )
The next example displays a one-line message centered on row 5
and returns to the calling procedure.
FT_DISPMSG( { { "Please Do Not Interrupt" } , ;
{ "W+/B", "GR+/B" } } , ;
, 5, )
Status:
Compliance:
Files:
See also:
FT_DOSVER
Lang:
dosver.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\dosver.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Return the current DOS major and minor version as a string
Syntax:
FT_DOSVER() ->
Arguments:
None
Returns:
A character string with the major version number first, a
period ("."), then the minor version number (e.g., "3.30")
Description:
FT_DOSVER() invokes DOS interrupt 21h, service 30 in order to
return the current DOS version. It does this by setting up
an array corresponding to machine registers and then calling
the toolkit function FT_INT86().
It returns a character string corresponding to the DOS
version, as follows: The major version, a period ("."), then
the minor version.
Examples:
FUNCTION main()
RETURN QOut( "Dos version: " + FT_DOSVER() )
Status:
Compliance:
Files:
See also:
FT_DOY()
Lang:
woy.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\woy.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Find number of day within year
Syntax:
FT_DOY( ) ->
Arguments:
is a date in the form "mm/dd/yy" or "mm/dd/yyyy"
Returns:
Return numeric position of day within the year.
Return NIL if parameter does not conform.
Description:
Finds the day number, considering 01/01 as day 1
Handles dates with CENTURY ON|OFF, to allow for 21st century.
Date validation must be external to this function.
Examples:
These code fragments find the day number, given a date.
// literal character date
dDate := CTOD("01/01/91")
nDayNum := FT_DOY(dDate) // result: 1
// presume DOS date to be 01/06/91
nDayNum := FT_DOY(DATE()) // result: 6
// date input
cDate := SPACE(8)
@ 4,10 get cDate PICT "##/##/##" // input 07/04/91
READ
nDayNum := FT_DOY(CTOD(cDate)) // result: 185
// last day of year
nDayNum := FT_DOY(CTOD("12/31/91")) // result: 365
For a demonstration of this function, compile and link the
program woy.prg in the Nanforum Toolkit source code.
Status:
Compliance:
Files:
See also:
FT_DSKFREE()
Lang:
diskfunc.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\diskfunc.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Return the amount of available disk space
Syntax:
FT_DSKFREE( [ ] ) -> nSpaceAvail
Arguments:
is the fixed disk to query. If no parameter is passed
the operation will be performed on the default drive. Do not
include the ":".
Returns:
Integer representing the available disk space in bytes.
Description:
Function to return the available space on the passed
drive letter or the default drive if no drive is passed.
Uses FT_INT86() through the internal function _ftDiskInfo().
Examples:
? FT_DSKFREE() // Returns free space on default drive.
Status:
Compliance:
Files:
See also:
FT_DSKSIZE()
Lang:
diskfunc.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\diskfunc.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Return the maximum capacity of a fixed disk
Syntax:
FT_DSKSIZE( [ ] ) -> nMaxCapacity
Arguments:
is the fixed disk to query. If no drive is sent, the
operation will be performed on the default drive. Send without
the ":".
Returns:
An integer representing the maximum disk capacity in bytes.
Description:
Function utilizing FT_INT86() to return Maximum Disk Size.
Uses FT_INT86() through the internal function _ftDiskInfo().
Examples:
? FT_DSKSIZE() // Maximum capacity for default drive
? FT_DSKSIZE( "D" ) // Maximum capacity for Drive D:
Status:
Compliance:
Files:
See also:
FT_E2D()
Lang:
e2d.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\e2d.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Convert scientific notation string to a decimal
Syntax:
FT_E2D( ) ->
Arguments:
Scientific notation string to convert
Returns:
Decimal number
Description:
Given a string in the format x.yEz, the decimal
equivalent is returned.
xYear can be a character, date or numeric describing the year
for which you wish to receive the date of Easter.
Returns:
The actual date that Easter occurs.
Description:
Returns the date of Easter for any year after 1582 up to Clipper's
limit which the manual states is 9999, but the Guide agrees with
the actual imposed limit of 2999.
This function can be useful in calender type programs that indicate
when holidays occur.
Examples:
dEdate := FT_EASTER( 1990 ) // returns 04/15/1990
Status:
Compliance:
Files:
See also:
FT_ELAPMIN()
Lang:
elapmil.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\elapmil.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Return difference, in minutes, between two mil format times.
Syntax:
FT_ELAPMIN( , ) -> nMINUTES
Arguments:
character strings of military form "hhmm",
where 0<=hh<24.
Returns:
Description:
Finds the arithmetic difference between time two times
(time 2 - time 1).
If time 2 is smaller than time 1, a NEGATIVE value is returned.
is any valid date in any date format. Defaults to DATE().
is any valid date in any date format. Defaults to DATE().
is a valid Time string of the format 'hh:mm:ss' where
hh is hours in 24-hour format.
is a valid Time string of the format 'hh:mm:ss' where
hh is hours in 24-hour format.
Returns:
A two-dimensional array containing elapsed time data.
Description:
FT_ELAPSED() calculates the elapsed time between two Date/Time events.
It returns an array which contains the following data:
aRetVal[1,1] Integer Days aRetVal[1,2] Total Days (nn.nnnn)
aRetVal[2,1] Integer Hours aRetVal[2,2] Total Hours (nn.nnnn)
aRetVal[3,1] Integer Minutes aRetVal[3,2] Total Minutes (nn.nnnn)
aRetVal[4,1] Integer Seconds aRetVal[4,2] Total Seconds (nn)
is the ASCII representation of the printer control
codes in Lotus 123 format (e.g. "\027E" for Chr(27)+"E")
"\nnn" will be converted to Chr(nnn)
"\\" will be converted to "\"
Returns:
The binary version of an ASCII coded printer setup string.
Description:
This function is useful for allowing the user to enter printer
control codes in Lotus-style ASCII format, and then having
this function convert that code to the format that the printer
needs to receive.
Examples:
cSetup = "\015" // default = Epson compressed print
UserInput( @cSetup ) // Let user modify setup code
SET DEVICE TO PRINT // get ready to print
?? FT_ESCCODE( cSetup ) // Output the converted code
Status:
Compliance:
Files:
See also:
FT_FAPPEND()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Appends a line to the currently selected text file
Syntax:
FT_FAPPEND( [ < nLines > ] ) -> NIL
Arguments:
is the number of lines that should be appended to the
end of the currently selected text file.
If is omitted, one record is appended.
Returns:
lSuccess. If FALSE, check ^bft_fError()^n for the error code.
Description:
This function appends a line of text to the file in the currently
selected text file workarea. Text lines are delimited with a
CRLF pair. The record pointer is moved to the last appended
record.
Multiple lines may be appended with one call to FT_FAPPEND().
A text file "record" is a line of text terminated by a CRLF pair.
Each line appended with this function will be empty.
NOTE: Occasionally a text file may contain a non-CRLF terminated
line, at the end of the file ("stragglers"). This function assumes
these stragglers to be the last line of the file, and begins
appending the new lines after this line. In other words, if the
last line in the text file is not terminated with a CRLF pair prior
to calling FT_FAPPEND(), the function will terminate that last line
before appending any new lines.
Examples:
// add a blank line of text to a file
FT_FUSE( "test.txt" )
?FT_FRECNO() // displays 5
FT_FAPPEND()
?FT_FRECNO() // displays 6
is a date within a month for which you want to find
the first date of that month. If not passed or is an incorrect type,
defaults to current system date.
Returns:
A Clipper date value representing the first date of the month.
Description:
This function will return the first day of the month of the date
passed, or the first day of the current month if no argument is
supplied.
Deletes a line from the currently selected text file
Syntax:
FT_FDELETE( [ < nLines > ] ) -> lSuccess
Arguments:
^b^n is the number of lines to be eliminated, beginning with
the current record position.
If ^b^n is omitted, the current record is deleted only.
Returns:
TRUE if successful, otherwise check ^ft_fError()^n for error code.
Description:
This function deletes one or several lines of text from the file
in the currently selected text file workarea. Text lines are
delimited with a CRLF pair. The record pointer is not moved,
unless the deleted lines occur at the end of the file, in which
case ^bft_fRecno()^n will equal ^bft_fLastRe()^n and ^bft_fEOF()^n
will be set to TRUE.
Examples:
// delete the next 4 lines from a file
FT_FUSE( "test.txt" )
FT_FDELETE( 4 )
Status:
Compliance:
Files:
See also:
FT_FAPPEND() FT_FRECNO() FT_FINSERT()
FT_FEOF()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Determine if end of text file has been encountered
Syntax:
FT_FEOF() -> lResult
Arguments:
None
Returns:
.T. if an attempt was made to skip past the last record of
the currently selected text file, otherwise .F.
Description:
This function is similar to the CLIPPER Eof() function.
A text file "record" is a line of text terminated by a CRLF pair.
The DOS error code if one occurred. See a reference on DOS error
codes for an explanation of what the code means.
Description:
This function returns the DOS error code associated with a file
operation on the currently selected text file.
Errors could stem from any open, create, read or write operation,
among others.
This function moves the record pointer to the last record of the
file in the currently selected text file workarea.
If a read error occurs ^ft_fError()^n will contain the error code.
A text file "record" is a line of text terminated by a CRLF pair.
Examples:
// read last line
FT_FUSE( "text.c" )
FT_FGOBOT()
? FT_FREADLN()
Move record pointer to specific record in a text file
Syntax:
FT_FGOTO( nLine ) -> NIL
Arguments:
is the record number to go to.
Returns:
NIL
Description:
This function moves the record pointer to a specific record
in the file in the currently selected text file workarea. If
the record number requested is greater than the number of records
in the file, the record pointer will be positioned at the last
record.
Internally, the function operates differently depending on how
you invoke it. Passing a value for ^b^n results in what
is effectively a skip operation, which is fairly quick. However
if you pass 0 for ^b^n, e.g. ft_fGoTo( 0 ), the function
internally goes to the top of the file, then skips down the
required number of records. Hence if your file is relatively
large and the current record is a high number, you may see some
delay as ft_fGoTo(0) skips through the file.
A text file "record" is a line of text terminated by a CRLF pair.
Examples:
// read 5th line of text from file
ft_fUse( "fttext.c" )
ft_fGoTo(5)
cText := ft_fReadLN()
Status:
Compliance:
Files:
See also:
FT_FRECNO() FT_FGOTOP() FT_FREADLN()
FT_FGOTOP()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Go to the first record in a text file
Syntax:
FT_FGOTOP() -> NIL
Arguments:
None
Returns:
NIL
Description:
This function moves the record pointer to the first record
in the currently selected text file workarea.
A text file "record" is a line of text terminated by a CRLF pair.
Examples:
FT_FUSE( "text.c" ) // open text file
DO WHILE !FT_FEOF()
? FT_FREADLN() // read thru file
FT_FSKIP()
ENDDO
FT_FGOTOP() // go back to top
? FT_FRECNO() // 1
Status:
Compliance:
Files:
See also:
FT_FSELECT() FT_FUSE() FT_FRECNO() FT_FGOBOT()
FT_FILL()
Lang:
menu1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\menu1.txt
Template:
Category:
Menus/Prompts
Subcategory:
Oneliner:
Declare menu options for FT_MENU1()
Syntax:
FT_FILL( , , ,
) -> NIL
Arguments:
is a sub-array of in FT_MENU1()
denoting the group in which to include the selection --
e.g., acOptions[1]
is the character string that will appear on
the menu.
is the code block to be executed when that menu
option is selected. i.e. {|| MyFunction() } would execute
the function called MyFunction(). {|| .f.} would exit the
FT_MENU1 and return to the calling routine. {|| .T.} would
do nothing.
is a logical variable that determines whether
the corresponding menu option is selectable or not.
Returns:
NIL
Description:
FT_FILL() is a function used to set up the menu options prior
to calling FT_MENU1().
Examples:
FT_FILL( aOptions[1], 'A. Execute A Dummy Procedure' , {|| fubar()}, .t. )
The above would be added to the sub-menu associated with the first menu
bar item, would execute the function FUBAR() when that option was
selected, and would be selectable.
FT_FILL( aOptions[3], 'B. Enter Daily Charges' , {|| .t.}, .f. )
The above would be added to the sub-menu associated with the third menu
bar item, and would be unselectable.
FT_FILL( aOptions[2], 'C. Enter Payments On Accounts', {|| .t.}, .t. )
The above would be added to the sub-menu associated with the second menu
bar item, and would be selectable, but would do nothing when selected.
FT_FILL( aOptions[4], 'C. Exit' , {|| .f.}, .t. )
The above would be added to the sub-menu associated with the fourth menu
bar item, and would be selectable, and would exit FT_MENU1() when chosen.
Status:
Compliance:
Files:
See also:
FT_MENU1()
FT_FINDITH()
Lang:
findith.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\findith.txt
Template:
Category:
String
Subcategory:
Oneliner:
Find the "ith" occurrence of a substring within a string
Syntax:
FT_FINDITH( , , ;
[, ] ) ->
Arguments:
is the string to search for.
is the string to search.
is the number of the occurrence to find.
is a logical indicating if the search is to be case
sensitive. The default is no case sensitivity (.F.).
Returns:
The position in the string cCheckIn of the ith occurrence of cCheckFor.
Description:
This function finds the position in a string of the "ith" time another
string appears in it.
Examples:
// Find the Position in cMemoString of
// the 10th Occurrence of "the", case
// insensitive
nNextPosition := FT_FINDITH("the", cMemoString, 10)
Status:
Compliance:
Files:
See also:
FT_AT2()
FT_FINSERT()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Inserts a line in the currently selected text file
Syntax:
FT_FINSERT( [ < nLines > ] ) -> lSuccess
Arguments:
^b^n is the number of lines that should be inserted at the
current record position.
If ^b^n is omitted, one record is inserted.
Returns:
^blSuccess^n is TRUE if the insert succeeded, FALSE if not. If
false check the return value of ^bft_fError()^n for the reason.
Description:
This function inserts a line of text in the file in the currently
selected text file workarea. Text lines are delimited with a
CRLF pair.
The record pointer is not moved.
A text file "record" is a line of text terminated by a CRLF pair.
Each line inserted with this function will be empty.
Examples:
// add a couple of blank lines of text to a file
ft fUse( "test.txt" )
ft_fGoTo( 10 )
ft_fInsert( 5 )
Get the no. of records in the currently selected text file
Syntax:
FT_FLASTRE() -> nLastRecordNum
Arguments:
None
Returns:
An integer containing the number of records in the text file in
the currently selected text file workarea, or zero if no file
is currently open in the workarea.
Description:
This function returns the number of the last record in a text file.
A text file "record" is a line of text terminated by a CRLF pair.
Examples:
FT_FUSE( "text.c" )
? FT_FLASTRE()
Status:
Compliance:
Files:
See also:
FT_FUSE() FT_FRECNO()
FT_FLOPTST()
Lang:
floptst.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\floptst.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Test diskette drive status
Syntax:
FT_FLOPTST( ) -> nStatus
Arguments:
is the diskette drive number, 0 = A:, 1 = B:
Returns:
-1 - Wrong Parameters
0 - Drive Loaded and ready to read or write
1 - Drive Door Open or Diskette inserted upside down
2 - Diskette is unformatted
3 - Write protected
4 - Undetermined
Description:
FT_FLOPTST() is designed as a full replacement for ISDRIVE(). Where
ISDRIVE() returns just .T. or .F. depending if the diskette drive is
ready or not, FT_FLOPTST() returns a numeric code designating the
diskette drive's status.
FT_FLOPTST() is particularly useful in backup and restore programs
that need to test the floppy drive before writing/reading from a
floppy disk.
No testing has been performed on systems with more than 2 floppy
drives. If the third drive is "C" and the fourth "D" then there
should be no problems.
This function does not currently check subst'd drives. So if you
have SUBST E: A:\ then FT_FLOPTST( ASC("E")-ASC("A") ) == 4
Any suggestions to fix this limitation are appreciated.
Examples:
iStatus := FT_FLOPTST( 0 )
DO CASE
CASE iStatus == 1
Qout( "The door to drive A is open." )
CASE iStatus == 2
Qout( "The diskette in drive A is not formatted." )
CASE iStatus == 3
Qout( "The diskette in drive A is write-protected." )
CASE iStatus == 4
Qout( "Something is wrong with drive A, but I don't know what." )
ENDCASE
Status:
Compliance:
Files:
See also:
FT_FREADLN()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Read a line from the currently selected text file
Syntax:
FT_FREADLN() -> cLine
Arguments:
None
Returns:
A string containing the current record in a text file.
Description:
This function returns a line of text read from the file in the
currently selected text file workarea. Text lines are delimited
with a CRLF pair. The record pointer is not moved.
Currently the maximum record size is 4096 characters. You may
increase the maximum record size by changing the value of ^b#define
^bBUFFSIZE^n in the C source and recompiling, however you should
consider the performance implications if you do (all read and writes
use this buffer size, including ft_fSkip()'s and ft_fGoto()'s).
If a read error occurs ^ft_fError()^n will contain the error code.
A text file "record" is a line of text terminated by a CRLF pair.
Examples:
// display each record of a text file
FT_FUSE( "text.c" )
DO WHILE ! FT_FEOF()
? FT_FREADLN()
FT_FSKIP()
ENDDO
Status:
Compliance:
Files:
See also:
FT_FUSE() FT_FWRITELN() FT_FRECNO() FT_FGOTOP()
FT_FRECNO()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Return the current record number of a text file
Syntax:
FT_FRECNO() -> nRecNo
Arguments:
None
Returns:
The current record number of a text file or 0 if no file is open.
Description:
This function returns the current record number of the file open
in the currently selected text file workarea.
A text file "record" is a line of text terminated by a CRLF pair.
Examples:
FT_FUSE( "text.c" ) // open text file
DO WHILE !FT_FEOF()
? FT_FREADLN() // read thru file
FT_FSKIP()
ENDDO
FT_FGOTOP() // go back to top
? FT_FRECNO() // 1
Status:
Compliance:
Files:
See also:
FT_FSELECT() FT_FUSE() FT_FGOTOP() FT_FGOBOT()
FT_FSELECT()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Select a text file workarea
Syntax:
FT_FSELECT( [ ] ) -> nPreviousArea
Arguments:
^b^n is the text file workarea to select.
Returns:
The current selected text file area.
Description:
This function selects a text file "workarea" from 1 to 10. A
file may or may not be open in the selected area.
Passing 0 for ^b^n selects the next available workarea,
similar to Clipper's SELECT 0 command. If no more workareas are
available the current workarea is not changed.
Each file is opened in its own "workarea", similar to the concept
used by dbf files. As provided, a maximum of 10 files (in 10
workareas) can be opened (assuming there are sufficient file
handles available). That number may be increased by modifying
the #define TEXT_WORKAREAS in the C source code and recompiling.
All the FT_F*() file functions operate on the file in the currently
selected text file workarea.
Text file workareas are separate from and independent of Clipper's
database workareas.
Examples:
FT_FSELECT(1)
nFile1 := FT_FUSE( "temp.c" )
? FT_FLASTRE() // no. of lines in temp.c
FT_FSELECT(2)
nFile2 := FT_FUSE( "temp.h" )
? FT_FLASTRE() // no. of lines in temp.h
Status:
Compliance:
Files:
See also:
FT_FUSE()
FT_FSKIP()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Move the record pointer to a new position in a text file
Syntax:
FT_FSKIP( [ ] ) -> nLinesSkipped
Arguments:
is the number of lines to skip. Defaults to 1 if
not specified.
Returns:
The number of lines actually skipped. If the file's EOF or
BOF was encountered before ^b^n could be skipped, the
return value will be less than ^b^n.
Description:
This function moves the text file record pointer, similar to
the CLIPPER SKIP command.
Use the return value to determine how many records were actually
skipped, for example to write a custom skipper function for
TBrowse'g text files.
If a read error occurs ^ft_fError()^n will contain the error code.
A text file "record" is a line of text terminated by a CRLF pair.
Examples:
// display each record of a text file
FT_FUSE( "text.c" )
DO WHILE ! FT_FEOF()
? FT_FREADLN()
FT_FSKIP()
ENDDO
Status:
Compliance:
Files:
See also:
FT_FRECNO() FT_FGOTOP()
FT_FUSE()
Lang:
fttext.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\fttext.txt
Template:
Category:
File I/O
Subcategory:
Oneliner:
Open or close a text file for use by the FT_F* functions
Syntax:
FT_FUSE( [ ] [, ] ) -> nHandle | 0
Arguments:
^b^n is the text file you want to open. If not specified,
the file currently open, if any, will be closed.
^b^n is the open mode for the file. Please refer to the
discussion of open modes under FOPEN() in the Clipper manual
and fileio.ch for a list of allowable open modes. If not
specified, the file will be opened with a mode of
FO_READ + FO_SHARED (64).
Returns:
If ^b^n is passed and the file is opened successfully, an
integer containing the text file's workarea. If the file cannot be
opened, -1 will be returned. In this case, check the return value
of ^bft_fError()^n for the cause of the error.
If FT_FUSE() is called without any arguments, it will close the
text file in the current "text area" and return 0.
If a read error occurs ^ft_fError()^n will contain the error code.
Description:
The FT_F*() file functions are for reading text files, that is,
files where each line (record) is delimited by a CRLF pair.
Each file is opened in its own "workarea", similar to the concept
use by dbf files. As provided, a maximum of 10 files (in 10
workareas) can be opened (assuming there are sufficient file
handles available). That number may be increased by modifying
the #define TEXT_WORKAREAS in the C source code and recompiling.
Examples:
#include "fileio.ch"
// open a text file for reading
ft_fUse( "text.txt" )
// open a text file for reading and writing
ft_fUse( "text.txt", FO_READWRITE + FO_SHARED )
// close file
ft_fUse()
is a string of data to write to the file at the current
record position.
is a logical indicating whether the contents
of the current record are to be preserved, that is, if lInsert
evaluates to .T., the a new record is inserted at the current
position. The current record then is pushed down to FT_FRECNO()+1.
If lInsert is .F. or omitted, the current record is replaced by
cData.
Returns:
TRUE if successful, otherwise check ^ft_fError()^n for error code.
Description:
This function writes a line of text to the file in the currently
selected text file workarea. Text lines are delimited with a
CRLF pair. The record pointer is not moved.
The contents of the current record are updated to reflect the new
new line written, unless the Insert option is selected.
Writing a null string has the effect of clearing the current line
if in overstrike mode, else inserting a new line (same as
FT_FINSERT()).
A text file "record" is a line of text terminated by a CRLF pair.
Examples:
// write a line of text to a file
FT_FUSE( "config.sys" )
DO WHILE UPPER( FT_FREADLN() ) != "FILES=" .AND. !F_FEOF()
FT_FSKIP()
ENDDO
FT_FWRITELN( "FILES=30", FT_FEOF() )
is the first number to find the GCD of.
is the second number to find the GCD of.
Returns:
The greatest common divisor of the 2 numbers, or 0 if either is 0.
Description:
This function calculates the greatest common divisor between 2 numbers,
i.e., the largest number that will divide into both numbers evenly. It
will return zero (0) if either number is zero.
is the variable to receive the environment data.
can be a character type variable, in which case
the function will place all environment strings in the variable
separated by carriage return/line feeds (chr 13 + chr(10)).
can be an array type, in which case the function
will place each string in an array element. The array MUST be
declared with the proper number of elements prior to passing it
to the function. This can be done by calling FT_GETE() without
parameters first to get the number of strings in the environment.
Note that the argument MUST be passed by reference. Since arrays
are by nature passed by reference, the "@" symbol is optional when
passing an array.
If no argument is passed, FT_GETE() merely returns the number
of strings in the environment.
Returns:
FT_GETE() returns the total number of strings found in the
current program's environment.
Description:
This function stores ALL of the current program's environment
variables in either a block of text lines or in an array. It is
useful for looking at the entire environment at once, or recording
a snapshot of it to a file for later inspection, such as when a
program error occurs. If the value of ONE SPECIFIC variable is
desired, use Clipper's built-in GETE() function.
Examples:
Get the environment in text form and browse it:
cEnvBlock := ""
nNumStrings := FT_GETE(@cEnvBlock)
@ 0, 0 to MAXROW() - 1, MAXCOL()
@ MAXROW(), 0 say 'Browse strings, press ESC to exit...'
MEMOWRIT(cEnvBlock, 1, 1, MAXROW() - 2,MAXCOL() - 1, .F.)
Get the environment in text form and write it to a file:
cEnvBlock := ""
FT_GETE(@cEnvBlock)
MEMOWRIT("environ.txt", cEnvBlock)
Get the environment in Array form:
aEnvArray := ARRAY(FT_GETE())
FT_GETE(aEnvArray)
? aEnvArray[1] // "COMSPEC=C:\command.com"
? aEnvArray[2] // "PATH=C:\;C:\windows;C:\util;C:\harbour"
... etc ...
Status:
Compliance:
Files:
See also:
FT_GETMODE()
Lang:
vidmode.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\vidmode.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Get the video mode
Syntax:
FT_GETMODE() -> nVMode
Arguments:
None.
Returns:
The video mode, as a numeric.
Description:
Use this function to find out what mode your display adapter is in.
Uses DOS interrupt 10h to get the mode. For a table of modes
available on various graphics adapters, refer to a book such
as Wilton's "Programmer's Guide to PC & PS/2 Video Systems"
(Microsoft Press)
Return info about the cursor on a specified video page
Syntax:
FT_GETVCUR( [ ] ) ->
Arguments:
is the video page to get the cursor information for.
Defaults to the current page, as returned by FT_GETVPG().
Returns:
A four-element array (), set up as follows:
aCurInfo[1] = Top line of cursor
aCurInfo[2] = Bottom line of cursor
aCurInfo[3] = Character row
aCurInfo[4] = Character column
Description:
FT_GETVCUR() uses FT_INT86() to invoke interrupt 10h, function
3, to return the character cursor location for the specified
video page.
The top line and bottom line of cursor are set depending on
the current cursor mode, and are only meaningful in alphanumeric
video modes.
For more information on graphics programming, cursors, and
cursor modes, refer to Richard Wilton's _Programmer's Guide to
PC and PS/2 Video Systems_ (Microsoft Press).
Examples:
aCurInfo := getVCur( 1 ) // Get info on cursor pos in page 1
QOut("Row: " + str( aCurInfo[3] ) + " Col: " + str( aCurInfo[4] ) )
Status:
Compliance:
Files:
See also:
FT_GETVPG()
Lang:
page.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\page.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Get the currently selected video page
Syntax:
FT_GETVPG() ->
Arguments:
None.
Returns:
The video page, as a numeric.
Description:
Get the currently selected video page
For more information on graphics programming and video pages,
consult a reference such as _Programmer's Guide to PC and PS/2
Video Systems_ (Microsoft Press).
Examples:
nPage := FT_GETVPG()
Status:
Compliance:
Files:
See also:
FT_SETVPG()
FT_HEX2DEC()
Lang:
hex2dec.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\hex2dec.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Convert a hex number to decimal
Syntax:
FT_HEX2DEC( ) -> nDecNum
Arguments:
is a character string representing a hex number.
Returns:
A decimal number.
Description:
Converts a hexadecimal number to a BASE 10 decimal number.
Useful for using FT_INT86().
Examples:
FT_INT86( HEX2DEC( "21" ), aRegs )
Converts 21h, the Dos Interrupt, to its decimal equivalent,
33, for use by FT_INT86().
Status:
Compliance:
Files:
See also:
FT_IAmIdle()
Lang:
iamidle.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\iamidle.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Inform the operating system that the application is idle.
Syntax:
FT_IAmIdle() -> lSuccess
Arguments:
None
Returns:
.T. if supported, .F. otherwise.
Description:
Some multitasking operating environments (e.g. Windows or OS/2) can
function more efficiently when applications release the CPU during
idle states. This function allows you "announce" to the operating
system that your application is idle.
Note that if you use this function in conjunction with FT_OnIdle(),
you can cause Clipper to automatically release the CPU whenever
Clipper itself detects an idle state.
Examples:
while inkey() != K_ESC
FT_IAmIdle() // Wait for ESC and announce idleness
end
* Here's another way to do it:
FT_OnIdle( {|| FT_IAmIdle()} )
Inkey( 0 ) // Automatically reports idleness until key
// is pressed!
Status:
Compliance:
Files:
See also:
FT_OnIdle()
FT_Idle()
Lang:
ftidle.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\ftidle.txt
Template:
Category:
Event
Subcategory:
Oneliner:
Generate an idle event to allow incremental garbage collection.
Syntax:
FT_Idle()
Arguments:
None
Returns:
NIL
Description:
During memory-intensive operations that do not generate much in
the way of idle states, the Clipper runtime may not get a chance to
perform garbage collection of discarded memory. This can eventually
lead to any of a variety of memory-related internal errors.
This function attempts to alleviate the problem by providing a
mechanism by which an idle event can be artifically generated at
will. The idle event will cause the CA-Cl*pper runtime to perform
an incremental memory scavenge.
This function makes use of an undocumented interal routine. If this
this fact makes you uncomfortable then don't use this function, you
miserable jello-spined lump of human debris.
Examples:
while Whatever // Some batch process
Something() // Create 'n' discard a bunch of stuff
FT_Idle() // Take out the garbage
end
Status:
Compliance:
Files:
See also:
FT_OnIdle()
FT_INVCLR()
Lang:
invclr.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\invclr.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Get the inverse of a color
Syntax:
FT_INVCLR( [ ] ) -> cColor
Arguments:
is the color to get the inverse of. Defaults to
current color.
Returns:
The inverse of the passed color.
Description:
This function inverts a passed color (in the Clipper format: ??/??),
e.g., "W/N" is converted to "N/W".
Examples:
cInverse := FT_INVCLR() // Get Inverse of Current Color
cInvErr := FT_INVCLR( cErrColor ) // Get Inverse of cErrorColor
Status:
Compliance:
Files:
See also:
FT_ISBIT()
Lang:
isbit.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\isbit.txt
Template:
Category:
String
Subcategory:
Oneliner:
Test the status of an individual bit
Syntax:
FT_ISBIT( , ) -> lResult
Arguments:
is a character from CHR(0) to CHR(255)
is a number from 0 to 7 conforming to standard right-to-left
bit-numbering convention and representing the position of the
bit within the byte.
Returns:
.T. if designated bit is set (1), .F. if not set (0), NIL if
invalid parameters.
Description:
Tests for status of any selected bit in the byte passed as a parameter.
Byte must be presented in CHR() form, as a literal constant, or as the
one-byte character result of an expression.
This function is presented to illustrate that bit-wise operations
are possible with Clipper code. For greater speed, write .c or
.asm versions and use the Clipper Extend system.
Examples:
This code tests whether bit 3 is set in the byte represented by
CHR(107):
lBitflag := FT_ISBIT(CHR(107), 3)
? lBitflag // result: .T.
This code tests whether bit 5 is set in the byte represented by ASCII
65 (letter 'A')
? FT_ISBIT('A', 5) // result: .F.
For a demonstration of Clipper bit manipulations, compile and
link the program bittest.prg in the Nanforum Toolkit source code.
Status:
Compliance:
Files:
See also:
FT_BITSET() FT_BITCLR()
FT_ISBITON()
Lang:
isbiton.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\isbiton.txt
Template:
Category:
String
Subcategory:
Oneliner:
Determine the state of individual bits in a number
Syntax:
FT_ISBITON( , ) -> lResult
Arguments:
is an integer for which a bit state needs to be checked.
is a number from 0 to 15 that indicates which bit to test.
Returns:
.T. if the specified bit was on., .F. if off.
Description:
This function is useful when dealing with binary integers. It will
come in very handy if you use the FT_INT86() function, because the
CPU flags are returned as a series of bits. Using this function, you
can determine the state of each CPU flag.
Examples:
if FT_ISBITON( nCPUFlags, 0 )
Qout( "The carry flag was set." )
endif
if FT_ISBITON( nCPUFlags, 7 )
Qout( "The sign flag was set." )
endif
Status:
Compliance:
Files:
See also:
FT_ISPRINT()
Lang:
ftisprn.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\ftisprn.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Check printer status
Syntax:
FT_ISPRINT( [ ] ) -> lResult
Arguments:
is optional and is the device to test (LPT2, COM1, etc.).
If omitted, the function will default to the PRN device.
Returns:
.T. if device is ready for output.
.F. if one of the following conditions occurs:
1) The device is not ready.
2) The device does not exist.
3) DOS couldn't open the device for some reason
(such as no file handles available).
Description:
The Clipper IsPrinter() function is somewhat limited because it only
works with LPT1. Furthermore, it talks directly to the hardware, so
if you have redirected LPT1 via the DOS MODE command, the IsPrinter()
function will return erroneous results.
This function offers a better alternative. Instead of talking to the
hardware, it issues a DOS call that checks to see if the device is
ready or not. That gives DOS an opportunity to deal with any
redirections, and since you pass the device name as a parameter, you
can test any device, not just LPT1 (note that the function defaults
to PRN if you fail to pass a valid parameter).
The function also temporarily traps the DOS critical error handler so
you don't get any nasty error messages if the device isn't ready. It
restores the old critical error handler before exiting.
Note that although this function is mainly designed for testing
printers, you can also check to see if a drive is ready. Since DOS
thinks the NUL device exists on every drive, you can pass a drive
letter followed by NUL as a parameter. If DOS is able to open the
NUL device, then the drive is ready, otherwise the door is open or
something else is wrong.
The source code is written to adhere to Turbo Assembler's IDEAL mode.
To use another assembler, you will need to rearrange the PROC and
SEGMENT directives, and also the ENDP and ENDS directives (a very
minor task).
Examples:
IF ! FT_ISPRINT()
Qout( "PRN is not ready!" )
ENDIF
IF ! FT_ISPRINT( "COM2" )
Qout( "Check the device on COM2. Something is wrong." )
ENDIF
IF ! FT_ISPRINT( "A:\nul" )
Qout( "Oops, better check drive A!" )
ENDIF
Status:
Compliance:
Files:
See also:
FT_ISSHARE()
Lang:
isshare.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\isshare.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Determine if DOS "Share" is installed
Syntax:
FT_ISSHARE() -> nRetCode
Arguments:
None
Returns:
nRetcode will be set as follows on exit:
0 if SHARE not loaded but ok to load
1 if SHARE not loaded and not ok to load
255 if SHARE loaded
Description:
Uses DOS interrupt 2Fh (MultiPlex interrupt), service 10h
to determine if DOS SHARE.COM is loaded.
Examples:
IF FT_ISSHARE() != 255
Qout("SHARE must be loaded!")
ENDIF
Status:
Compliance:
Files:
See also:
FT_INT86()
FT_LASTKEY()
Lang:
setkeys.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\setkeys.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Force LastKey() to return a programmer-defined value.
Syntax:
FT_LastKey( ) -> NIL
Arguments:
is the Inkey() value of the desired key.
Returns:
NIL
Description:
It is occasionally useful to force LastKey() to return a known value.
This is easily accomplishing by using the KEYBOARD command, but this
has undesireable side effects (the keyboard buffer is cleared, and
the keystroke is processed whether you needed it to be or not). This
function accomplishes the same task but without the side effects. It
does so by directly modifying the memory location where Clipper stores
the LastKey() value.
Some highly unorthodox programming techniques, not to mention rather
strange use of Clipper internals, was necessary to make this function
work. If this makes you uncomfortable, then don't use this function,
you worthless crybaby.
Force LastKey() to return a programmer-defined value.
Syntax:
FT_LastKey( ) -> NIL
Arguments:
is the Inkey() value of the desired key.
Returns:
NIL
Description:
It is occasionally useful to force LastKey() to return a known value.
This is easily accomplishing by using the KEYBOARD command, but this
has undesireable side effects (the keyboard buffer is cleared, and
the keystroke is processed whether you needed it to be or not). This
function accomplishes the same task but without the side effects. It
does so by directly modifying the memory location where Clipper stores
the LastKey() value.
Some highly unorthodox programming techniques, not to mention rather
strange use of Clipper internals, was necessary to make this function
work. If this makes you uncomfortable, then don't use this function,
you worthless crybaby.
is a date within a month for which you want to find
the last date of that month. If not passed or is an incorrect
type, defaults to current system date.
Returns:
A Clipper date value representing the last date of the month.
Description:
This function will return the last day of the month of the date
passed, or the last day of the current month if no argument is
supplied.
is a character string containing one or more function
calls
Returns:
.T. if all functions within the string are currently linked into
the application, .F. if one or more aren't. See below for a
definition of "function."
Description:
This function would be used in data driven application to determine
whether or not a macro compiled function was linked in.
Several functions can be passed, and nested, in .
Caveat: Some function calls are converted by the preprocessor
into other function calls. You cannot have these types of
functions in a macro compiled string as they never exist at
runtime. FT_LINKED will correctly tell you that they are invalid.
For instance: there is no function called SORT() in any of the
Nantucket LIBraries, but it is a valid CLIPPER command because the
preprocessor will convert it to other function calls.
Examples:
cString := "FT_GoodFunc(BadFunc(3,2))"
IF FT_LINKED(cString)
EVAL( &("{||"+cString+"}") )
ELSE
ALERT("Error: "+cString+" was not linked in. Called by FT_LINKED()")
ENDIF
Status:
Compliance:
Files:
See also:
FT_MADD()
Lang:
madd.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\madd.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Add or subtract months to/from a date
Syntax:
FT_MADD( [ ], [ ], [ ] )
-> dDate
Arguments:
is any valid date in any date format. Defaults to
current system date if not supplied.
is the number of months to be added or subtracted.
Defaults to 0 if not supplied.
is a logical variable indicating whether or not to
force the returned date to the last date of the month. It only
affects the returned date if is an end-of-month date.
Returns:
A date.
Description:
FT_MADD() adds or subtracts months to/from a given date.
If MakeEOM is passed and dGivenDate is the last day of a month,
it will return the EOM of calculated month. Otherwise it will
return the same day as the day of the passed date.
is the mouse button number:
0 - Left Button
1 - Right Button
2 - Middle Button [if applicable]
is the number of times the specified button was pressed
since the last call to this routine. PASSED BY REFERENCE.
is the X position of the cursor when the last press occurred.
PASSED BY REFERENCE.
is the Y position of the cursor when the last press occurred.
PASSED BY REFERENCE.
Returns:
An integer representing the button status:
0 - no buttons pressed
1 - left button pressed
2 - right button pressed
3 - left and right pressed
4 - middle pressed
5 - left and middle pressed
6 - middle and right buttons pressed
7 - all 3 buttons pressed
Description:
Retrieves the mouse button status and the position of the cursor when
a button was last pressed.
Examples:
IF Empty( FT_MBUTPRS(1) )
? "No Item selected"
ENDIF
is the mouse button number:
0 - Left Button
1 - Right Button
2 - Middle Button [if applicable]
is the number of times the specified button was pressed
since the last call to this routine. PASSED BY REFERENCE.
is the X position of the cursor when the last press occurred.
PASSED BY REFERENCE.
is the Y position of the cursor when the last press occurred.
PASSED BY REFERENCE.
Returns:
An integer representing the button status:
0 - no buttons pressed
1 - left button pressed
2 - right button pressed
3 - left and right pressed
4 - middle pressed
5 - left and middle pressed
6 - middle and right buttons pressed
7 - all 3 buttons pressed
Description:
Retrieves the mouse button status and the position of the cursor when
a button was last pressed.
Examples:
IF Empty( FT_MBUTPRS(1) )
? "No Item selected"
ENDIF
is the mouse button number
0 - Left Button
1 - Right Button
2 - Middle Button [if applicable]
is the number of times the specified button was released
since the last call to this routine. PASSED BY REFERENCE.
is the X position of the cursor when the last release occurred.
PASSED BY REFERENCE.
is the Y position of the cursor when the last release occurred.
PASSED BY REFERENCE.
Returns:
- an integer representing button release status
0 - None
1 - Left
2 - Right
3 - Middle
Description:
This function returns the release status of the mouse buttons and the
coordinates of the last release.
is the mouse button number
0 - Left Button
1 - Right Button
2 - Middle Button [if applicable]
is the number of times the specified button was released
since the last call to this routine. PASSED BY REFERENCE.
is the X position of the cursor when the last release occurred.
PASSED BY REFERENCE.
is the Y position of the cursor when the last release occurred.
PASSED BY REFERENCE.
Returns:
- an integer representing button release status
0 - None
1 - Left
2 - Right
3 - Middle
Description:
This function returns the release status of the mouse buttons and the
coordinates of the last release.
, are the four corners of the
screen region in row and column coordinates.
Returns:
NIL
Description:
This function tells the mouse driver to hide the cursor if it is in
the given region. The driver hides the cursor by decrementing the cursor
flag. A call to FT_MSHOWCRS is required to turn the cursor back on.
Calling FT_MSHOWCRS also disables this function.
See FT_MSHOWCRS for a discussion of the cursor display flag.
is a logical indicating whether to set the mouse cursor on.
.T. - set mouse cursor on
.F. - set mouse cursor off
If omitted, no change is made to cursor state
Returns:
A logical indicating the previous mouse cursor state.
Description:
This function works like most Clipper state functions. If no value
is sent to FT_MCURSOR() it will return the state of the mouse cursor.
Examples:
IF !( FT_MCURSOR() )
FT_MCURSOR( .T. )
ENDIF
Status:
Compliance:
Files:
See also:
FT_MCURSOR()
Lang:
mouse2.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse2.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Set the mouse cursor
Syntax:
FT_MCURSOR( [ ] ) -> lCursorState
Arguments:
is a logical indicating whether to set the mouse cursor on.
.T. - set mouse cursor on
.F. - set mouse cursor off
If omitted, no change is made to cursor state
Returns:
A logical indicating the previous mouse cursor state.
Description:
This function works like most Clipper state functions. If no value
is sent to FT_MCURSOR() it will return the state of the mouse cursor.
is a numeric value. If it is zero FT_MDBLCLK() will not
check for the first press but rather will simply wait the
specified period for a single press. This is useful if this
routine is called from one which in turn responded to a button
press. If it is not present or not equal to 0, then FT_MDBLCLK()
will wait for two presses of the specified button.
is the mouse button number
0 - Left Button
1 - Right Button
2 - Middle Button [if applicable]
is the interval to wait for the first click if requested
and the time to wait for the second. If not present then defaults
to 0.5 second.
is the row number for the mouse cursor location for a double click
to be valid. If not present then the current position is taken as
the valid location.
is the column number for the mouse cursor location for a double
click to be valid. If not present, then the current position is
taken as the valid location.
is an optional start time for the waiting period for the first
click (of either one or two requested). If not given then the
time is set at entry into this routine. This is useful when this
routine is called from another routine which was called in
response to a mouse click but needs to know if a double click
has occurred
Returns:
.T. if a double click was detected.
Description:
This is a mouse meta function that checks for the presence
of a double click.
Examples:
IF FT_MISREGION( 10, 10, 11, 20 ) .AND.;
FT_MDBLCLK(0,1,,FT_MGETX(),FT_MGETY()) // double click, right button
// at current location with
// default interval
MnuItem1()
ENDIF
Status:
Compliance:
Files:
See also:
FT_MBUTPRS() FT_MBUTREL()
FT_MDEFCRS()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Define the mouse cursor
Syntax:
FT_MDEFCRS( , , ) -> NIL
Arguments:
is the cursor type. A value of 0 indicates the software cursor
(the default) and a value of 1 indicates the hardware cursor.
is the screen mask for the software cursor or the first scan
line of the hardware cursor. See the description for more
information.
is the cursor mask for the software cursor of the last scan
line of the hardware cursor. See the description for more
information.
Returns:
NIL
Description:
In text mode the mouse cursor can either be a software generated or
the actual hardware cursor. This routine allows one choose between them.
The software cursor is the default and its effect on the character it
covers is determined by the screen mask and the cursor mask. Both of
these masks are 16 bit values (which in Clipper are passed as standard
numerical values). The 16 bit masks are arranged in a manner identical
to the way information is stored for each character cell on the screen.
The low order 8 bits represent the actual character displayed while the
high order bits represent the display atributes such as blinking,
intensity and forground and background colors. The mask is represented in
the diagram below:
Bit: ³15 ³14 12³11 ³10 8³7 0³
Function:³blink ³background³intensity³foreground³character³
Blinking and high intensity are on when the bit is 1. The background and
foreground indicate which colors are used for each. The software mouse
cursor uses these two values by taking the mask from the screen cell it
is on and performing a logical AND on each bit with the screen mask
value. The result is then logically XOR'ed with the cursor mask value.
Thus to keep the character the same but invert the foreground and
background colors the following values would be used:
Bit: ³15 ³14 12³11 ³10 8³7 0³
Function:³blink ³background³intensity³foreground³character³
screen: ³ 0 ³ 111 ³ 0 ³ 111 ³11111111 ³ =30719
cursor: ³ 0 ³ 111 ³ 0 ³ 111 ³00000000 ³ =30464
The hardware cursor is the text cursor provided by the video board. One
specifies the range of scan lines which are on using and
. The range of values is dependant upon the type of monitor.
The first scan line is 0.
Examples:
Status:
Compliance:
Files:
See also:
FT_MDEFCRS()
Lang:
mouse2.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse2.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Define the mouse cursor
Syntax:
FT_MDEFCRS( , , ) -> NIL
Arguments:
is the cursor type. A value of 0 indicates the software cursor
(the default) and a value of 1 indicates the hardware cursor.
is the screen mask for the software cursor or the first scan
line of the hardware cursor. See the description for more
information.
is the cursor mask for the software cursor of the last scan
line of the hardware cursor. See the description for more
information.
Returns:
NIL
Description:
In text mode the mouse cursor can either be a software generated or
the actual hardware cursor. This routine allows one choose between them.
The software cursor is the default and its effect on the character it
covers is determined by the screen mask and the cursor mask. Both of
these masks are 16 bit values (which in Clipper are passed as standard
numerical values). The 16 bit masks are arranged in a manner identical
to the way information is stored for each character cell on the screen.
The low order 8 bits represent the actual character displayed while the
high order bits represent the display atributes such as blinking,
intensity and forground and background colors. The mask is represented in
the diagram below:
Bit: ³15 ³14 12³11 ³10 8³7 0³
Function:³blink ³background³intensity³foreground³character³
Blinking and high intensity are on when the bit is 1. The background and
foreground indicate which colors are used for each. The software mouse
cursor uses these two values by taking the mask from the screen cell it
is on and performing a logical AND on each bit with the screen mask
value. The result is then logically XOR'ed with the cursor mask value.
Thus to keep the character the same but invert the foreground and
background colors the following values would be used:
Bit: ³15 ³14 12³11 ³10 8³7 0³
Function:³blink ³background³intensity³foreground³character³
screen: ³ 0 ³ 111 ³ 0 ³ 111 ³11111111 ³ =30719
cursor: ³ 0 ³ 111 ³ 0 ³ 111 ³00000000 ³ =30464
The hardware cursor is the text cursor provided by the video board. One
specifies the range of scan lines which are on using and
. The range of values is dependant upon the type of monitor.
The first scan line is 0.
Examples:
Status:
Compliance:
Files:
See also:
FT_MENU1()
Lang:
menu1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\menu1.txt
Template:
Category:
Menus/Prompts
Subcategory:
Oneliner:
Pulldown menu system
Syntax:
FT_MENU1( , , ,
[, ], [ ] ) -> NIL
Arguments:
is a character array containing the names to appear
on the menu bar.
is a multi-dimensional array with one element for each
selection to appear on the pulldown menus.
is an array containing the colors for the menu groups.
is a numeric value that determines the row for the menu
bar. If omitted, it defaults to 0.
is a logical variable. If true (.T.) or omitted, it
uses FT_SHADOW() to add a transparent shadow to the each
pulldown menu. If false (.F.), the menu is drawn without
the shadow.
All arguments except nTopRow and lShadow are required.
Returns:
NIL
Description:
FT_MENU1() is a function that displays a pulldown menu for each item
on the menu bar and executes the corresponding function for the item
selected. When a called function returns false, FT_MENU1 returns
control to the calling program.
Valid keystrokes and their corresponding actions:
Home - Activates Pulldown for first item on the menu bar
End - Activates Pulldown for last item on the menu bar
Left Arrow - Activates next Pulldown to the left
Right Arrow - Activates next Pulldown to the right
Tab - Same as Right Arrow
Shift-Tab - Same as Left Arrow
Page Up - Top item on current Pulldown menu
Page Down - Bottom item on current Pulldown menu
Enter - Selects current item
Alpha Character - Moves to closest match and selects
Alt- - Moves to corresponding menu bar item
Escape - Prompts for confirmation and either returns to
the calling routine or resumes
Examples:
// Declare arrays
LOCAL aColors := {}
LOCAL aBar := { " ENTER/EDIT ", " REPORTS ", " DISPLAY " }
// Include the following two lines of code in your program, as is.
// The first creates aOptions with the same length as aBar. The
// second assigns a three-element array to each element of aOptions.
LOCAL aOptions[ LEN( aBar ) ]
AEVAL( aBar, { |x,i| aOptions[i] := { {},{},{} } } )
// fill color array
// Box Border, Menu Options, Menu Bar, Current Selection, Unselected
aColors := iif( lColor, {"W+/G", "N/G", "N/G", "N/W", "N+/G"}, ;
{"W+/N", "W+/N", "W/N", "N/W","W/N"} )
// array for first pulldown menu
FT_FILL( aOptions[1], 'A. Execute A Dummy Procedure' , {|| fubar()}, .t. )
FT_FILL( aOptions[1], 'B. Enter Daily Charges' , {|| .t.}, .f. )
FT_FILL( aOptions[1], 'C. Enter Payments On Accounts', {|| .t.}, .t. )
// array for second pulldown menu
FT_FILL( aOptions[2], 'A. Print Member List' , {|| .t.}, .t. )
FT_FILL( aOptions[2], 'B. Print Active Auto Charges' , {|| .t.}, .t. )
// array for third pulldown menu
FT_FILL( aOptions[3], 'A. Transaction Totals Display', {|| .t.}, .t. )
FT_FILL( aOptions[3], 'B. Display Invoice Totals' , {|| .t.}, .t. )
FT_FILL( aOptions[3], 'C. Exit To DOS' , {|| .f.}, .t. )
Call FT_FILL() once for each item on each pulldown menu, passing it
three parameters:
FT_FILL( , , is a character string which will be displayed on
the pulldown menu.
should contain one of the following:
A function name to execute, which in turn should return .T. or .F.
FT_MENU1 WILL RETURN CONTROL TO THE CALLING PROGRAM IF .F. IS
RETURNED OR CONTINUE IF .T. IS RETURNED.
.F. WHICH WILL CAUSE FT_MENU1 TO RETURN CONTROL TO THE CALLING
PROGRAM.
.T. WHICH WILL DO NOTHING. THIS ALLOWS THE DEVELOPER TO DESIGN A
SKELETON MENU STRUCTURE PRIOR TO COMPLETING ALL OF THE SUBROUTINES.
// CALL FT_MENU1
FT_MENU1( aBar, aOptions, aColors, 0 )
NOTE: FT_MENU1() disables Alt-C and Alt-D in order to make them
available for the menu bar. It enables Alt-D and resets
Alt-C to its previous state prior to calling each function.
Status:
Compliance:
Files:
See also:
FT_FILL()
FT_MENU2()
Lang:
vertmenu.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\vertmenu.txt
Template:
Category:
Menus/Prompts
Subcategory:
Oneliner:
Vertical lightbar menu
Syntax:
FT_MENU2( [, ] ) -> NIL
Arguments:
is an array of menu options, messages, and action
blocks.
Each element in this array is a nested array with the structure:
element[x, 1] = menu option
element[x, 2] = message to be displayed when option is highlighted
element[x, 3] = code block to be executed when option is selected
is a string containing colors for the prompts, in the same
format as that returned by Set( _SET_COLOR ). If not supplied,
colors default to the current color setting.
Returns:
NIL
Description:
This function greatly simplifies the process of displaying light-bar
menus. All prompts are padded out with spaces so they are the same
length, a box is drawn around the prompts, the box is automatically
centered on the screen, and the underlying screen is restored after
a menu selection has been made.
Additionally, because you can tie action blocks to each menu
option, you can save on a lot of DO CASE or IF..ELSEIF code in your
main program. See the test code for a succinct demonstration.
Execute light bar menu using prompts created with @...PROMPT
Syntax:
#include "ftmenuto.ch"
MENU TO [COLD]
Arguments:
is the name of the variable to which the result of the menu
selection should be assigned.
[COLD] is optional and if specified indicates that trigger characters
should be treated as "cold," i.e. rather than causing the menu item
to be selected it only causes the light bar to move to that selection.
Returns:
Description:
This enhanced version of MENU TO requires the inclusion of the header
file ftmenuto.ch in any source file that uses it. It may be used in
place of the standard Clipper MENU TO command. However, in the
interests of functionality it is NOT 100% compatible (in particular,
you should make sure that the target memvar exists before executing
the menu -- the Clipper version will create a PRIVATE memvar for you
if it does not already exist, but this version does not). No whining!
If compatibility is such a big deal then use the standard Clipper
command.
Note that this command can also be called using function-style
syntax. See the entry for FT_MENUTO() for further details.
Examples:
#include "ftmenuto.ch"
// Simple command
MENU TO memvar
Status:
Compliance:
Files:
See also:
FT_Prompt()
FT_METAPH()
Lang:
metaph.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\metaph.txt
Template:
Category:
String
Subcategory:
Oneliner:
Convert a character string to MetaPhone format
Syntax:
FT_METAPH( [, ] ) -> cMetaPhone
Arguments:
is the character string to convert
is the length of the character string to be returned.
If not specified the default length is 4 bytes.
Returns:
A phonetically spelled character string
Description:
This function is a character function use to index and search for
sound-alike or phonetic matches. It is an alternative to
the SOUNDEX() function, and addresses some basic pronunciation
rules, by looking at surrounding letters to determine how parts of
the string are pronounced. FT_METAPH() will group sound-alikes
together, and forgive shortcomings in spelling ability.
Examples:
USE Persons
INDEX ON FT_METAPH( LastName ) TO LastName
SEEK FT_METAPH( "Philmore" )
? FOUND(), LastName // Result: .T. Philmore
SEEK FT_METAPH( "Fillmore" )
? FOUND(), LastName // Result: .T. Philmore
Status:
Compliance:
Files:
See also:
FT_MGETCOORD()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Get mouse cursor position (text coord.) and button status
Syntax:
FT_MGETPOS( @, @ ) -> nButtonStatus
Arguments:
is a variable that will receive the mouse X position in text
screen coordinates. It must be passed by reference.
is a variable that will receive the mouse Y position in text
screen coordinates. It must be passed by reference.
Returns:
an integer representing button status
- 0 for no button pressed
- 1 for left pressed
- 2 for right pressed
- 3 for left and right pressed
- 4 for middle pressed
- 5 for left and middle pressed
- 6 for right and middle pressed
- 7 for all three buttons pressed
Description:
Loads cursor position into x and y coordinates passed by reference and
returns the button status.
Examples:
LOCAL nX, nY
LOCAL nButton := FT_MGETCOORD( @nX, @nY )
? "Mouse Row :", nX
? "Mouse Column :", nY
? "Button Status:", nButton
Get mouse cursor position (text coord.) and button status
Syntax:
FT_MGETPOS( @, @ ) -> nButtonStatus
Arguments:
is a variable that will receive the mouse X position in text
screen coordinates. It must be passed by reference.
is a variable that will receive the mouse Y position in text
screen coordinates. It must be passed by reference.
Returns:
an integer representing button status
- 0 for no button pressed
- 1 for left pressed
- 2 for right pressed
- 3 for left and right pressed
- 4 for middle pressed
- 5 for left and middle pressed
- 6 for right and middle pressed
- 7 for all three buttons pressed
Description:
Loads cursor position into x and y coordinates passed by reference and
returns the button status.
Examples:
LOCAL nX, nY
LOCAL nButton := FT_MGETCOORD( @nX, @nY )
? "Mouse Row :", nX
? "Mouse Column :", nY
? "Button Status:", nButton
is the display page on which the mouse is currently being
displayed
Description:
This function gets the display page for the mouse cursor. The valid
values of nPage is dependent upon the display mode. See FT_SETVPG()
for changing the current video page
is a variable that will receive the mouse X position in virtual
screen coordinates. It must be passed by reference.
is a variable that will receive the mouse Y position in virtual
screen coordinates. It must be passed by reference.
Returns:
an integer representing button status
- 0 for no button pressed
- 1 for left pressed
- 2 for right pressed
- 3 for left and right pressed
- 4 for middle pressed
- 5 for left and middle pressed
- 6 for right and middle pressed
- 7 for all three buttons pressed
Description:
Loads cursor position into x and y coordinates passed by reference and
returns the button status. The coordinate system in text mode has
eight virtual coordinates per character cell. Thus x=16 means that you
are in the Row 2. The values returned by this routine when in text mode
and with mouse driver versions 6 and above are multiples of 8. We have
experience with drivers prior to that version
Examples:
LOCAL nX, nY
LOCAL nButton := FT_MGETPOS( @nX, @nY )
? "Mouse Row :", nX
? "Mouse Column :", nY
? "Button Status:", nButton
is a variable that will receive the mouse X position in virtual
screen coordinates. It must be passed by reference.
is a variable that will receive the mouse Y position in virtual
screen coordinates. It must be passed by reference.
Returns:
an integer representing button status
- 0 for no button pressed
- 1 for left pressed
- 2 for right pressed
- 3 for left and right pressed
- 4 for middle pressed
- 5 for left and middle pressed
- 6 for right and middle pressed
- 7 for all three buttons pressed
Description:
Loads cursor position into x and y coordinates passed by reference and
returns the button status. The coordinate system in text mode has
eight virtual coordinates per character cell. Thus x=16 means that you
are in the Row 2. The values returned by this routine when in text mode
and with mouse driver versions 6 and above are multiples of 8. We have
experience with drivers prior to that version
Examples:
LOCAL nX, nY
LOCAL nButton := FT_MGETPOS( @nX, @nY )
? "Mouse Row :", nX
? "Mouse Column :", nY
? "Button Status:", nButton
is the percentage of maximum horizontal sensitivity. PASSED
BY REFERENCE.
is the percentage of maximum vertical sensitivity. PASSED BY
REFERENCE.
is the percentage of maximum sensitivity for doubling the
mouse cursor's speed on the screen. PASSED BY REFERENCE.
Returns:
NIL
Description:
This function returns the current values of the mouse movement
sensitivity parameters. The first two arguments control the amount of
movement necessary to move the cursor a given amount. The third argument
determines the threshold above which the mouse moves at twice the normal
speed. For further discussion of these values see FT_MSETSENS()
Examples:
FT_MGETSENS( @nHoriz, @nVert, @nDouble )
Status:
Compliance:
Files:
See also:
FT_MSETSENS()
FT_MGETX()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Get mouse cursor row position
Syntax:
FT_MGETX() -> nRowPos
Arguments:
NONE
Returns:
which is the row position of mouse in virtual screen
coordinates.
Description:
Retrieves mouse's row position in virtual screen coordinates. The
values returned are multiples of 8 when in text mode and with at least
Microsoft drivers 6 and above.
which is the row position of mouse in virtual screen
coordinates.
Description:
Retrieves mouse's row position in virtual screen coordinates. The
values returned are multiples of 8 when in text mode and with at least
Microsoft drivers 6 and above.
Column position of mouse in virtual screen coordinates
Description:
Retrieves mouse's column position in virtual screen coordinates. The
values returned are multiples of 8 when in text mode and with at least
Microsoft drivers 6 and above.
Column position of mouse in virtual screen coordinates
Description:
Retrieves mouse's column position in virtual screen coordinates. The
values returned are multiples of 8 when in text mode and with at least
Microsoft drivers 6 and above.
Decrement internal mouse cursor flag and hide mouse cursor
Syntax:
FT_MHIDECRS() -> NIL
Arguments:
NONE
Returns:
NIL
Description:
Hides the mouse cursor. Make sure to turn the mouse cursor off when
redrawing screens. The mouse cursor dutifully saves the screen
under it, so if you draw over the mouse cursor it will create a
"hole" in your screen when you move the mouse cursor.
Note: A call to FT_MHIDECRS() decrements a mouse driver variable
which indicates whether the cursor is shown. The cursor is visible
only when the variable = 0. Thus multiple calls to FT_MHIDECRS()
require an equal number of calls to FT_MSHOWCRS() before the cursor
will again be visible. Once the variable is 0 calls to FT_MSHOWCRS()
does not increment the varaible above 0.
Examples:
FT_MHIDECRS()
@ 10, 10 to 20, 20
FT_MSHOWCRS()
Status:
Compliance:
Files:
See also:
FT_MSHOWCRS() FT_MCONOFF()
FT_MHIDECRS()
Lang:
mouse2.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse2.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Decrement internal mouse cursor flag and hide mouse cursor
Syntax:
FT_MHIDECRS() -> NIL
Arguments:
NONE
Returns:
NIL
Description:
Hides the mouse cursor. Make sure to turn the mouse cursor off when
redrawing screens. The mouse cursor dutifully saves the screen
under it, so if you draw over the mouse cursor it will create a
"hole" in your screen when you move the mouse cursor.
Note: A call to FT_MHIDECRS() decrements a mouse driver variable
which indicates whether the cursor is shown. The cursor is visible
only when the variable = 0. Thus multiple calls to FT_MHIDECRS()
require an equal number of calls to FT_MSHOWCRS() before the cursor
will again be visible. Once the variable is 0 calls to FT_MSHOWCRS()
does not increment the varaible above 0.
Examples:
FT_MHIDECRS()
@ 10, 10 to 20, 20
FT_MSHOWCRS()
Status:
Compliance:
Files:
See also:
FT_MSHOWCRS() FT_MCONOFF()
FT_MIL2CIV()
Lang:
miltime.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\miltime.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Convert time in military format to civilian format.
Syntax:
FT_MIL2CIV( ) -> dMILTIME
Arguments:
character string of form hhmm, where 0<=hh<24.
Returns:
character string of form hh:mm (am,pm,n or m),
where 0
Description:
Converts time from military to civilian format
Examples:
FT_MIL2CIV( "1640" ) -> 4:40 pm
FT_MIL2CIV( "0440" ) -> 4:40 am
FT_MIL2CIV( "1200" ) -> 12:00 n
FT_MIL2CIV( "0000" ) and FT_MIL2CIV( "2400" ) -> 12:00 m
Caution: leading blanks are irrelevant.
Initialize the mouse driver, vars and return status of mouse
Syntax:
FT_MINIT() -> lMouseStatus
Arguments:
NONE
Returns:
An logical representing the mouse status (.F. == mouse not installed)
Description:
Initializes the mouse drive, associated variables and returns mouse
status. It checks to see if the mouse has been previously initialized
and if so it does not reinitialize. The row and column limits of mouse
movement is set to the maximum for the current video mode.
Use FT_MSHOWCRS() to display the mouse cursor.
Examples:
IF .NOT. FT_MINIT()
? "No mouse driver is installed"
ENDIF
Status:
Compliance:
Files:
See also:
FT_MRESET()
FT_MINREGION()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Test if the mouse cursor is in the passed region
Syntax:
FT_MINREGION( , , , ) -> lInRegion
Arguments:
, are the four corners of the screen region.
Returns:
.T. if mouse is in specified region.
Description:
This function will check to see if the mouse cursor is
within the confines of the specified region.
0 if successful
3 if Path Not Found
5 if Access Denied or directory already exists
99 if invalid parameters passed
Description:
Use this function to create the subdirectories needed by your
application. It might be especially useful in an installation
program.
The source code is written to adhere to Turbo Assembler's IDEAL mode.
To use another assembler, you will need to rearrange the PROC and
SEGMENT directives, and also the ENDP and ENDS directives (a very
minor task).
is a variable that will receive the vertical mickey count.
is a variable that will receive the horizontal mickey count.
Returns:
NIL
Description:
and must be passed by reference to receive
the mouse position in Mickeys.
Examples:
FT_MMICKEYS( @nX, @nY )
? nX
? nY
Status:
Compliance:
Files:
See also:
FT_MONTH()
Lang:
month.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\month.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Return Calendar or Fiscal Month Data
Syntax:
FT_MONTH( [ ], [nMonthNum] ) -> aDateInfo
Arguments:
is any valid date in any date format. Defaults
to current system date if not supplied.
is a number from 1 to 12 signifying a month.
Defaults to current month if not supplied.
Returns:
A three element array containing the following data:
aDateInfo[1] - The year and month as a character string "YYYYMM"
aDateInfo[2] - The beginning date of the month
aDateInfo[3] - The ending date of the month
Description:
FT_MONTH() returns an array containing data about the month
containing the given date.
Normally the return data will be based on a year beginning
on January 1st with weeks beginning on Sunday.
The beginning of year date and/or beginning of week day can be
changed by using FT_DATECNFG(), which will affect all subsequent
calls to FT_MONTH() until another call to FT_DATECNFG().
The beginning of year date and beginning of week day may be reset
to January 1 and Sunday by calling FT_DATECNFG() with no
parameters.
Examples:
// get info about month containing 9/15/90
aDateInfo := FT_MONTH( CTOD("09/15/90") )
? aDateInfo[1] // 199009 (9th month)
? aDateInfo[2] // 09/01/90 beginning of month 9
? aDateInfo[3] // 09/30/90 end of week month 9
// get info about month 5 in year containing 9/15/90
aDateInfo := FT_MONTH( CTOD("09/15/90"), 5 )
? aDateInfo[1] // 199005
? aDateInfo[2] // 05/01/90 beginning of month 5
? aDateInfo[3] // 05/31/90 end of month 5
// get info about month 5 in current year (1991)
aDateInfo := FT_MONTH( , 5 )
? aDateInfo[1] // 199105
? aDateInfo[2] // 05/01/91 beginning of month 5
? aDateInfo[3] // 05/31/91 end of month 5
Status:
Compliance:
Files:
See also:
FT_DATECNFG() FT_WEEK() FT_QTR() FT_YEAR()
FT_MRESET()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Reset mouse driver and return status of mouse
Syntax:
FT_MRESET() -> nMouseStatus
Arguments:
NONE
Returns:
An integer representing the mouse status (0 == mouse not installed)
Description:
Resets the mouse driver and returns mouse status. Use FT_MSHOWCRS()
to display the mouse cursor. The mouse is set to allow it to cover the
complete screen (as defined by MAXCOL() and MAXROW()). This is necessary
because at least some versions of the mouse drivers do not operate
according to the documentation when confronted with a 43 or 50 line
screen.
Normally, FT_MINIT() should be used to initialize the mouse since it
will not reinitialize if already done.
Examples:
IF Empty( FT_MRESET() )
? "No mouse driver is installed"
ENDIF
Status:
Compliance:
Files:
See also:
FT_MINIT() FT_MSHOWCRS()
FT_MRESET()
Lang:
mouse2.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse2.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Reset mouse driver and return status of mouse
Syntax:
FT_MRESET() -> nMouseStatus
Arguments:
NONE
Returns:
An integer representing the mouse status (0 == mouse not installed)
Description:
Resets the mouse driver and returns mouse status. Use FT_MSHOWCRS()
to display the mouse cursor. The mouse is set to allow it to cover the
complete screen (as defined by MAXCOL() and MAXROW()). This is necessary
because at least some versions of the mouse drivers do not operate
according to the documentation when confronted with a 43 or 50 line
screen.
Normally, FT_MINIT() should be used to initialize the mouse since it
will not reinitialize if already done.
Examples:
IF Empty( FT_MRESET() )
? "No mouse driver is installed"
ENDIF
Status:
Compliance:
Files:
See also:
FT_MINIT() FT_MSHOWCRS()
FT_MSETCOORD()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Position the mouse cursor using text screen coordinates
Syntax:
FT_MSETPOS( , ) -> NIL
Arguments:
is the desired mouse row.
is the desired mouse column.
Returns:
NIL
Description:
Positions mouse cursor on screen using text (normal row and column)
coordinates.
Examples:
FT_MSETCOORD( 10, 20 ) // position mouse cursor at row 10, col 20
// in text screen coordinates
This function sets the display page for the mouse cursor. The valid
values of nPage is dependent upon the display mode. See FT_SETVPG()
for changing the current video page
Examples:
FT_MSETPAGE( 1 ) // Sets the mouse cursor to page 1
Status:
Compliance:
Files:
See also:
FT_MGETPAGE()
FT_MSETPOS()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Position the mouse cursor using virtual screen coordinates
Syntax:
FT_MSETPOS( , ) -> NIL
Arguments:
is the desired mouse row.
is the desired mouse column.
Returns:
NIL
Description:
Positions mouse cursor on screen. The virtual coordinate system in text
mode has eight virtual coordinates per character cell. Thus x=16 means
that you are in the Row 2.
Examples:
FT_MSETPOS( 10, 20 ) // position mouse cursor at row 10, col 20
// in virtual screen coordinates
Position the mouse cursor using virtual screen coordinates
Syntax:
FT_MSETPOS( , ) -> NIL
Arguments:
is the desired mouse row.
is the desired mouse column.
Returns:
NIL
Description:
Positions mouse cursor on screen. The virtual coordinate system in text
mode has eight virtual coordinates per character cell. Thus x=16 means
that you are in the Row 2.
Examples:
FT_MSETPOS( 10, 20 ) // position mouse cursor at row 10, col 20
// in virtual screen coordinates
is the sensitivity of the mouse on the horizontal axis. This
value is the integer percentage of highest sensitivity and
thus has a range of 1 to 100. The default value is 50 and at
this setting about 3.2 inches of mouse movement will move
the mouse cursor across the screen. If NIL, the current
value is used.
is the relative sensitivity of the mouse on the vertical axis.
The value is an integer percentage of the highest sensitivity
and thus has a range of 1 to 100. The default value is 50 and
requires about 2 inches of mouse movement will move from top
to bottom of the screen.If NIL, the current value is used.
is the relative sensitivity of the mouse to doubling the ratio
of cursor movement to mouse movement. The default
value is 50. If NIL, the current value is used.
Returns:
NIL
Description:
This function allows one to control the mouse movement sensitivity. The
first two arguments control the amount of movement necessary to move
the cursor a given amount. The values are the percentage of full
sensitivity and the default values after installing the mouse driver
is 50 which represents approximately 3.2 inches of horizontal
and 2 inches of vertical mouse movement to cover the entire screen.
A value of 100 requires about 0.9 inches of horizontal mouse movement to
cover the screen from one side to the other.
The third argument changes the threshold above which the mouse moves at
twice the normal speed. The value is a percentage of full sensitivity
with the default (50) providing doubling at 64 mickeys per second.
NOTE: These values are NOT restored after resetting the mouse driver/
hardware. A well behaved application should reset them to the
original value upon exiting.
NOTE: The above description is counter to all of the documentation
I have available. However, it does not work the way it is documented
with Microsoft drivers versions 6.16, 6.24, 7.04 and 8.20. The above
movement values are documented to be the number of mickeys per 8
pixels and the double speed value as the number mickeys per second
required to double the speed. Each of these values should range from 1
to 32K but the driver forces a maximum of 100. Also the documentation
states that resetting the mouse will reset these values. This is not
the case.
Examples:
FT_MSETSENS( 75,75,50 ) // a little less mouse movement necessary.
Status:
Compliance:
Files:
See also:
FT_MGETSENS()
FT_MSHOWCRS()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Increment internal cursor flag and display mouse cursor
Syntax:
FT_MSHOWCRS() -> NIL
Arguments:
NONE
Returns:
NIL
Description:
Displays the mouse cursor. Make sure to turn the mouse cursor off
when redrawing screens. The mouse cursor dutifully saves the screen
under it, so if you draw over the mouse cursor it will create a "hole"
in your screen when you move the mouse cursor.
Note: A call to FT_MHIDECRS() decrements a mouse driver variable
which indicates whether the cursor is shown. The cursor is visible
only when the variable = 0. Thus multiple calls to FT_MHIDECRS()
require an equal number of calls to FT_MSHOWCRS() before the cursor
will again be visible. Once the variable is 0 calls to FT_MSHOWCRS()
does not increment the variable above 0.
Examples:
IF Empty( FT_MRESET() )
FT_MSHOWCRS()
ENDIF
Status:
Compliance:
Files:
See also:
FT_MHIDECRS() FT_MCONOFF()
FT_MSHOWCRS()
Lang:
mouse2.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse2.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Increment internal cursor flag and display mouse cursor
Syntax:
FT_MSHOWCRS() -> NIL
Arguments:
NONE
Returns:
NIL
Description:
Displays the mouse cursor. Make sure to turn the mouse cursor off
when redrawing screens. The mouse cursor dutifully saves the screen
under it, so if you draw over the mouse cursor it will create a "hole"
in your screen when you move the mouse cursor.
Note: A call to FT_MHIDECRS() decrements a mouse driver variable
which indicates whether the cursor is shown. The cursor is visible
only when the variable = 0. Thus multiple calls to FT_MHIDECRS()
require an equal number of calls to FT_MSHOWCRS() before the cursor
will again be visible. Once the variable is 0 calls to FT_MSHOWCRS()
does not increment the variable above 0.
Examples:
IF Empty( FT_MRESET() )
FT_MSHOWCRS()
ENDIF
Status:
Compliance:
Files:
See also:
FT_MHIDECRS() FT_MCONOFF()
FT_MVERSION()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Get the mouse driver version
Syntax:
FT_MVERSION( <@nMinor>, <@nType>, <@nIRQ> ) ->
Arguments:
is the Minor version number. PASSED BY REFERENCE.
is the Mouse type. PASSED BY REFERENCE.
1 = Bus Mouse
2 = Serial Mouse
3 = InPort Mouse
4 = PS/2 Mouse
5 = HP Mouse
is the IRQ number used for the mouse. PASSED BY REFERENCE.
0 = PS/2
2,3,4,5 or 7 = IRQ number
Returns:
which is the major version number of the mouse driver.
Description:
This function returns the current values of the mouse driver version
number and type. The major version would be 6 and the minor version
would be 10 if the driver were version 6.10. The mouse type and IRQ
numbers are also returned.
NOTE: It appears that the values reported when one starts the mouse
driver actually have the minor version in hexadecimal! Thus on bootup
my screen showed 6.24 but this routine returned 30 for the minor version
number!
Examples:
nMajor:=FT_MVERSION( @nMinor )
IF (nMajor+nMinor/100)<7.2
? "Sorry mouse driver version too old"
RETURN
ENDIF
Status:
Compliance:
Files:
See also:
FT_MSETSENS()
FT_MXLIMIT()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Set vertical bounds of mouse using virtual screen coord.
Syntax:
FT_MXLIMIT( , ) -> NIL
Arguments:
is the top row limit.
is the bottom row limit.
Returns:
NIL
Description:
Set maximum vertical bounds of mouse using virtual screen coordinates.
Examples:
FT_MXLIMIT( 10, 20 )
Status:
Compliance:
Files:
See also:
FT_MYLIMIT() FT_MINREGION()
FT_MXLIMIT()
Lang:
mouse2.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse2.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Set vertical bounds of mouse using virtual screen coord.
Syntax:
FT_MXLIMIT( , ) -> NIL
Arguments:
is the top row limit.
is the bottom row limit.
Returns:
NIL
Description:
Set maximum vertical bounds of mouse using virtual screen coordinates.
Examples:
FT_MXLIMIT( 10, 20 )
Status:
Compliance:
Files:
See also:
FT_MYLIMIT() FT_MINREGION()
FT_MYLIMIT()
Lang:
mouse1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse1.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Set horiz. bounds of mouse using virtual screen coordinates
Syntax:
FT_MYLIMIT( , ) -> NIL
Arguments:
is the left column limit.
is the right column limit.
Returns:
NIL
Description:
Set maximum horizontal bounds of mouse using virtual screen coordinates.
Examples:
FT_MYLIMIT( 10, 20 )
Status:
Compliance:
Files:
See also:
FT_MXLIMIT() FT_MINREGION()
FT_MYLIMIT()
Lang:
mouse2.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\mouse2.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Set horiz. bounds of mouse using virtual screen coordinates
Syntax:
FT_MYLIMIT( , ) -> NIL
Arguments:
is the left column limit.
is the right column limit.
Returns:
NIL
Description:
Set maximum horizontal bounds of mouse using virtual screen coordinates.
Examples:
FT_MYLIMIT( 10, 20 )
Status:
Compliance:
Files:
See also:
FT_MXLIMIT() FT_MINREGION()
FT_N2COLOR()
Lang:
n2color.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\n2color.txt
Template:
Category:
String
Subcategory:
Oneliner:
Returns the string complement of a Clipper color number
Syntax:
FT_COLOR2N( ) -> cColor
Arguments:
a number representing a Clipper color
Returns:
The string complement of a number representing a Clipper or a
null string if the parameter is invalid
Description:
This function is useful for converting a number to a Clipper color
string.
Examples:
cColor := FT_COLOR2N( 239 ) // returns "*+w/gr"
Status:
Compliance:
Files:
See also:
FT_N2COLOR()
FT_NETPV()
Lang:
netpv.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\netpv.txt
Template:
Category:
Math
Subcategory:
Oneliner:
Calculate net present value
Syntax:
FT_NETPV( , , ;
[, ] ) -> nNetPV
Arguments:
is the amount of cash invested for purposes
of generating the cash flows.
is the annual interest rate used to discount
expected cash flows (10.5% = 10.5, not .105).
is an array of the expected cash receipts each year.
is the number of years cash flows are expected
(optional, Len( aCashFlow ) ).
Returns:
The difference between the initial investment and the discounted
cash flow in dollars.
Description:
This function calculates the net present value, the difference
between the cost of an initial investment and the present value
of the expected cash flow(s) from the investment. The present
value of the expected cashflow(s) is calculated at the specified
interest rate, which is often referred to as the "cost of capital".
This function can be used to evaluate alternative investments.
The larger the NPV, the more profitable the investment. See
also the FutureValue and PresentValue for further explanations.
The formula to calculate the net present value is:
NetPresentValue = SUM(CashFlow[i] / ((1 + InterestRate) ** i))
FOR i = 1 TO NoOfCashFlows
Find the number of times one string occurs in another
Syntax:
FT_NOOCCUR( , ;
[, ] ) ->
Arguments:
is the string to search for
is the string to search
is a boolean variable to force case sensitivity
(optional, defaults to .F.).
Returns:
The number of times appears in
Description:
This function finds the number of times a string occurs in a
second string.
Examples:
// Find the number of times "the" appears in cMemoString, case
// insensitive
nNoOfOccurrences := FT_NOOCCUR( "the", cMemoString )
// Find the number of times "the" appears in cMemoString, case
// sensitive
nNoOfOccurrences := FT_NOOCCUR( "the", cMemoString, .T. )
Status:
Compliance:
Files:
See also:
FT_NTOW()
Lang:
ntow.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\ntow.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Translate numeric value to words
Syntax:
FT_NTOW( ) -> cWords
Arguments:
An integer to translate
Returns:
A text string representing
Description:
Translates numeric input to a text string.
FT_NTOW is intended to be used with integers only. Since I don't
know what your application will be, I can't assume the type of
fraction you want returned (ninety nine cents, 99/100, .99, etc).
If you want the fraction in words, just pass it as an integer.
Do not pass a negative number! Handle negative numbers any way
you need to in your code. (ie: CR, DB, Negative, Minus, etc.)
Also, numeric 0 is returned as a null string. You will need to
make a decision how to output it (zero dollars, no dollars, etc).
Examples:
? FT_NTOW( 999 ) -> Nine Hundred Ninety Nine
? FT_NTOW( 1000 ) -> One Thousand
? FT_NTOW( 23 ) + " Dollars and " + FT_NTOW( 99 ) + " Cents"
-> Twenty Three Dollars and Ninety Nine Cents
? FT_NTOW( 23 ) + " Dollars and " + "99/100"
-> Twenty Three Dollars and 99/100
x := -23.99
cents := str( (x - int( x )) * 100, 2, 0 ) + "/100"
x := int( x )
string := iif( x < 0, "Credit of ", "Debit of " )
? string + FT_NTOW( abs(x) ) + " Dollars and " + "99/100"
-> Credit of Twenty Three Dollars and 99/100
Status:
Compliance:
Files:
See also:
FT_NUMLOCK()
Lang:
numlock.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\numlock.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Return status of NumLock key
Syntax:
FT_NUMLOCK( [ ] ) -> lCurrentSetting
Arguments:
is optional and if supplied is the new setting
for the CapLock key. Specify .T. to turn CapLock on, or .F. to
turn it off.
Returns:
lValue is .T. if NumLock is set, .F. if it isn't set. The value
returned represents the setting in effect prior to any changes that
might by made by .
Description:
This function is useful if you need to know or set the status of the
NumLock key for some reason.
Examples:
IF FT_NUMLOCK()
Qout( "NumLock is active" )
ENDIF
Another one, slightly strange, courtesy of Glenn Scott:
function numBlink()
local lOldNum := ft_numlock()
while inkey( .5 ) != 27
ft_numlock( !ft_numlock() )
end
return ft_numlock( lOldNum )
Return the current Novell NetWare logical station number
Syntax:
FT_NWLSTAT() -> nStatNum
Arguments:
None
Returns:
A numeric corresponding to the current logical station number
assigned by NetWare.
Description:
In order to find out information about a particular node logged
in to a NetWare server, you will need the logical
station number, also known as a "connection number." This
function will return that number. This will be a number from 1 to 100
under NetWare 286, or from 1 to 250 under NetWare 386. This is *not*
the same as a physical station number.
This function requires FT_INT86().
This function does NOT test for the existence of the NetWare shell.
The behavior is undefined if no shell is loaded.
Examples:
QOut( "Logical station: " + str( FT_NWLSTAT() ) )
Status:
Compliance:
Files:
See also:
FT_NWSEMCLOSE()
Lang:
nwsem.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\nwsem.txt
Template:
Category:
NetWare
Subcategory:
Oneliner:
Close a NetWare semaphore
Syntax:
FT_NWSEMCLOSE( ) -> nRc
Arguments:
is the semaphore handle, returned from a previous call
to FT_NWSEMOPEN().
Returns:
nRc, a numeric, as follows:
0 - success
255 - invalid semaphore handle
Description:
Call FT_NWSEMCLOSE() when the app is finished. This decrements
the open count for the semaphore. If the open count hits zero,
the semaphore is deleted by NetWare.
Examine a NetWare semaphore's value and open count
Syntax:
FT_NWSEMEX( , <@nValue>, <@nOpenCnt> ) -> nRc
Arguments:
is the semaphore handle, returned from a previous call
to FT_NWSEMOPEN().
<@nValue> will get the current semaphore value. THIS NUMERIC
ARGUMENT MUST BE PASSED BY REFERENCE!
<@nOpenCnt> will get the current number of workstations
that have opened the semaphore. THIS NUMERIC ARGUMENT MUST BE
PASSED BY REFERENCE!
Returns:
nRc, a numeric, as follows:
0 - success
255 - invalid semaphore handle
In addition, nValue will be set to the semaphore's current value,
and nOpenCnt will be set to the number of stations that have
opened the semaphore.
Description:
See the description for FT_NWSEMOPEN().
Examples:
nInitVal := 2
nHandle := 0
nOpenCnt := 0
FT_NWSEMOPEN( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt )
nRc := FT_NWSEMWAIT( nHandle )
IF nRc == 254
QOUT( "All slots for this resource are currently in use" )
QUIT
ENDIF
FT_NWSEMEX( nHandle, @nValue, @nOpenCnt )
QOUT( "Semaphore test -> Open at [" + ;
ALLTRIM(STR(nOpenCnt)) + ;
"] stations, value is [" + ;
ALLTRIM(STR(nValue)) + "]" )
is the name of a semaphore you want to "lock."
is the semaphore's handle, if you get the lock.
THIS MUST BE PASSED BY REFERENCE!
Returns:
lRet == .t. if you get the lock, .f. if you don't.
If the lock succeeds, will contain the semaphore
handle. If it fails, the value of is undefined.
Description:
FT_NWSEMLOCK() uses the Nanforum Toolkit's NetWare Semaphore API
functions in order to provide a general purpose "lock" you can use in
a NetWare environment.
An interesting byproduct of NetWare's semaphore functions is
the "open count" which tells you how many connections have this
semaphore open. This is different from the semaphore's _value_,
which is set when the semaphore is opened and changed with
signal() and wait().
The point of semaphores is that you don't care how many users
are using the resource; you merely wait on a semaphore until
the resource becomes available or you give up. When you're done,
you signal it and off you go.
Back to the open count. FT_NWSEMLOCK() opens the semaphore
as named in . After it is opened, the open count
is checked. If it is anything other than 1, that means someone
else has it (or you failed in your open) so the semaphore is
closed and the "lock" is refused. If the value is 1, then your
app is that 1 station so the "lock" is granted.
You can use a semaphore lock to control access to anything
that Clipper's RLOCK() and FLOCK() can't help you with, such
as text files written with the low level file i/o functions,
etc.
Examples:
LOCAL nHandle := 0
IF FT_NWSEMLOCK( "k:\apps\error.log", @nHandle )
// Note, you aren't actually LOCKING this file, you are
// just locking a semaphore by the same name. As long as
// all apps that might be using this file are cooperating
// with the same kind of semaphore lock, you can effectively
// control access to the file.
ELSE
QOUT("Couldn't lock file.")
ENDIF
* Processing, then:
FT_NWSEMUNLOCK( nHandle )
is the semaphore name, maximum length is 127 characters.
is the initial value for the semaphore. It must start
as a positive number, to a maximum of 127.
<@nHandle> is the semaphore handle. THIS MUST BE PASSED BY
REFERENCE! On exit, will contain a numeric value that
refers to the opened semaphore. You will need it to pass to
other semaphore functions! PASS IT BY REFERENCE!
<@nOpenCnt> is the number of stations that have opened the
semaphore. THIS MUST BE PASSED BY REFERENCE! On exit,
will contain a numeric value.
Returns:
nRc, a numeric result code, as follows:
0 - success
254 - Invalid semaphore name length
255 - Invalid semaphore value
will contain the semaphore handle, and
will contain the number of stations that have opened
the semaphore.
Description:
A semaphore is simply a label that indirectly controls network
activity. There is a semaphore name, which can be up to 127
characters, and an associated value, which can range from 0 to
127.
A semaphore can be used for many things, but is most often used
to limit the number of users in an application, and to control
access to a network resource.
A semaphore essentially allows you to place locks on resources
other than files.
An application begins the process by calling FT_NWSEMOPEN().
If the semaphore doesn't exist, NetWare will create it.
FT_NWSEMOPEN() returns a handle that is used in other semaphore
calls.
Applications use FT_NWSEMWAIT() to wait for a semaphore to
become available. FT_NWSEMWAIT() decrements the semaphore's
value by 1. If the value > 0, then the application should
be allowed to access the semaphore's resource. If the value
goes negative, then the application is placed in a queue.
How long your app is in the queue is determined by how you
set the timeout parameter. If you can't get the resource in
the time you allot, you're let out of the queue and the
value increments by 1 again.
When an application finishes with a semaphore, it should
call FT_NWSEMSIG() to increment the value, and then
FT_NWSEMCLOSE() to close the semaphore. When the semaphore's
open count goes to 0, NetWare deletes it.
FT_NWSEMEX() can be used to examine the value and open count
without affecting them.
For an interesting discussion on the operating system aspects
of semaphores, check "Operating Systems Design and Implementation"
by A. Tanenbaum, page 60. For more details on NetWare's
semaphore facilities, refer to Charles Rose's "Programmer's
Guide to NetWare". The "Programmer's Guide" will make an
excellent companion guide to the source code for all NetWare
functions in the Nanforum Toolkit.
is the semaphore handle, returned from a previous call
to FT_NWSEMOPEN().
Returns:
nRc, a numeric, as follows
0 - success
1 - semaphore overflow ( value > 127 )
255 - invalid semaphore handle
Description:
Use FT_NWSEMSIG() when your app has finished with the resource
locked by a semaphore. This will increase the value (thus
making a slot available to another app).
For more information, see the description under FT_NWSEMOPEN().
is the semaphore handle returned from FT_NWSEMLOCK()
Returns:
lRet == .t. if you successfully unlock the semaphore, .f. if
you don't. If this call fails, it could be that you're passing
an invalid semaphore handle.
Description:
This call unlocks a semaphore prevsiously locked via FT_NWSEMLOCK().
It is important that you get a valid semaphore handle from
FT_NWSEMLOCK() before you use this call. Make sure when you call
FT_NWSEMLOCK() that you pass a numeric parameter in for the handle
BY REFERENCE.
Examples:
LOCAL nHandle := 0
IF FT_NWSEMLOCK( "k:\apps\error.log", @nHandle )
// Note, you aren't actually LOCKING this file, you are
// just locking a semaphore by the same name. As long as
// all apps that might be using this file are cooperating
// with the same kind of semaphore lock, you can effectively
// control access to the file.
ELSE
QOUT("Couldn't lock file.")
ENDIF
* Processing, then:
FT_NWSEMUNLOCK( nHandle )
is the semaphore handle, returned from a previous call
to FT_NWSEMOPEN().
is an optional parameter telling how long you wish to
wait on this semaphore. This is a numeric indicating the number
of clock ticks (approx 1/18 sec ) to wait. A zero (the default)
means "don't wait."
Returns:
nRc, a numeric, as follows:
0 - success
254 - timeout failure
255 - invalid semaphore handle
Description:
See the description for the FT_NWSEMOPEN() function.
Examples:
FT_NWSEMOPEN( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt )
nRc := FT_NWSEMWAIT( nHandle )
IF nRc == 254
QOUT( "All slots for this resource are currently in use" )
QUIT
ENDIF
is a connection number, or logical station number,
to find a userid for. Under NetWare 286, this number can be from
1 to 100. Under NetWare 386, 1-250. If not supplied, FT_NWUID()
defaults to the current connection (i.e., the connection running
the application).
Returns:
A string containing the userid, or "login name."
The maximum length of this string, as defined by current
versions of Novell NetWare, is 48 characters.
Description:
FT_NWUID() returns the current NetWare userid, or "login
name." This is useful for implementing security or audit
trail procedures within your programs.
There is no simple way a user can "fool" this function into
retrieving an incorrect value, provided a NetWare shell is loaded.
This function requires FT_INT86() and FT_NWLSTAT()
This function does NOT test for the existence of the NetWare shell.
The behavior is undefined if no shell is loaded. You'll usually get
garbage. This function has not been tested on NetWare 386.
Examples:
QOut( "I am: " + FT_NWUID() )
FOR x := 1 TO 100
cUid := FT_NWUID( x )
IF .NOT Empty( cUid )
QOut( Str( x, 3 ) + Space(3) + cUid )
ENDIF
NEXT
Status:
Compliance:
Files:
See also:
FT_OnTick()
Lang:
ontick.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\ontick.txt
Template:
Category:
Event
Subcategory:
Oneliner:
Evaluate a designated code block at a designated interval.
Syntax:
FT_OnTick( bCode, nInterval )
Arguments:
is the code block to evaluate.
is the number of clock ticks to wait between
evaluations of the code block.
Returns:
NIL
Description:
This function effectively allows you to run tasks in the background
by transparently and periodically calling a designated routine.
To halt the execution of the background function, call FT_OnTick()
with no arguments.
This function makes heavy use of several undocumented internal
routines. If this fact makes you uncomfortable then don't use
this function, you quivering sack of cowardly slime.
Examples:
// Set up a self-updating on-screen clock
FT_OnTick( "CLOCK", 9 )
procedure Clock
local nRow := Row()
local nCol := Col()
@ 0, 0 say Time()
SetPos( nRow, nCol )
return
Status:
Compliance:
Files:
See also:
FT_ORIGIN()
Lang:
origin.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\origin.txt
Template:
Category:
Environment
Subcategory:
Oneliner:
Report the drive, path and filename of the current program
Syntax:
FT_ORIGIN() -> cString
Arguments:
None
Returns:
A string containing the full drive/directory/filename of
the currently executing file.
Description:
Often users will install multiple copies of application software,
especially on networks and in situations where the user is trying
to get around a copy protection scheme.
This function enables you to learn the name and source location
of the currently executing file, so that you may take whatever
action you need to.
Requires DOS v3.xx and above.
Examples:
cMyFile := FT_ORIGIN()
IF cMyFile != "C:\appdir\myfile.exe"
?"Incorrect startup file. Please remove/rename and start again"
QUIT
ENDIF
Status:
Compliance:
Files:
See also:
FT_WHEREIS() FT_TREE()
FT_PCHR()
Lang:
pchr.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\pchr.txt
Template:
Category:
String
Subcategory:
Oneliner:
Convert printer control codes
Syntax:
FT_PCHR( ) ->
Arguments:
is the representation of the printer control codes in
text, numeric, hexadecimal, Epson command format, or any combination
separated by commas.
Returns:
A character string of printer control codes.
Description:
This function is useful for allowing the user to enter printer
control codes in text (enclosed in double quotes), numeric,
hexadecimal, or Epson commands preceded by a slash and returns
the printer control code equivalent.
NOTES"
- Combinations of text, numbers, hex, and commands must be
separated by commas ("A",27,&1B,/RESET).
- Text must be enclosed in double quotes ("x").
- Hexadecimal must be preceded by an ampersand (&1B).
- Epson commands, listed below, must be preceded by a forward
slash (/RESET).
Epson commands: (slash commands are specific to the Epson)
Job Control:
/RESET or /INIT Reset or initialize the printer
/BELL or /BEEP Cause the printer's speaker to beep (not HS)
/CAN Clear print buffers (not MX)
/SLOW Set low speed mode (not CR, HS, MX)
/FAST Cancel low speed mode (not CR, HS, MX)
/ONE Select Unidirectional mode
/TWO Select Directional mode
/ON Activate printer
/OFF Turn off printer
/FF or /EJECT Form Feed
Page Control:
/1/6 Set 6 lines per inch
/1/8 Set 8 lines per inch
/SKIP Set Skip perforation ON
/SKIPOFF Set Skip perforation OFF
Font Selection and Manipulation:
/ITALIC Select italic char. set (only FX86, EX, LX,
no LQ-1500, SX)
/GRAPHIC Select graphic char. set (only FX86, EX, LX,
no LQ-1500, SX)
/ROMAN Choose Roman font
/SANS Choose Sans Serif font
/DRAFT Choose draft
/NLQ Choose near letter quality
/PICA Choose 10 chars per inch
/ELITE Choose 12 chars per inch
/COND or /SI Choose 15 chars per inch
/EMPH Turn emphasize on
/EMPHOFF Turn emphasize off
/SPANISH Select spanish international char set
/USA Select USA international char set
Examples:
cSetUp := '27,116,1'
Set Print ON
? FT_PCHR( cSetUp ) -> (CHR(27)+CHR(116)+CHR(1))
Status:
Compliance:
Files:
See also:
FT_PEEK()
Lang:
peek.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\peek.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Retrieve a byte from a specified memory location.
Syntax:
FT_PEEK( , ) -> nValue
Arguments:
is the segment of the desired memory address.
is the offset of the desired memory address.
Returns:
will be a value from 0 to 255 if all parameters were valid and
the function was able to retrieve the desired byte.
will be -1 if invalid parameters were passed.
Description:
Use this function if you have a need to examine a specific memory
location. The function will return the byte at the specified
address as a numeric value. If you need this value as a character,
use the Chr() function to convert it.
This function was written for version 5.1 of MicroSoft C. You may
have to modify the source code to use another compiler.
Examples:
local nVMode := FT_PEEK( 0, 1097 ) // Get the current video mode
Status:
Compliance:
Files:
See also:
FT_PEGS()
Lang:
pegs.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\pegs.txt
Template:
Category:
Game
Subcategory:
Oneliner:
FT_PEGS GAME (all work and no play...)
Syntax:
FT_PEGS() -> NIL
Arguments:
None
Returns:
NIL
Description:
This function can be used to alleviate boredom. The object is to
remove all pegs except one. This is done by jumping over adjacent
pegs.
Examples:
FT_PEGS()
Status:
Compliance:
Files:
See also:
FT_PENDING()
Lang:
pending.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\pending.txt
Template:
Category:
Menus/Prompts
Subcategory:
Oneliner:
Display same-line pending messages after a wait.
Syntax:
FT_PENDING ( , [ ], [ ], ;
[ ], [ ] ) -> NIL
Arguments:
is the message string to display.
is an optional screen row for message display, default row 24.
is an optional screen col for message display, default col 0.
is an optional wait (sec) between messages, default 5 sec.
is an optional color string for displayed messages, default
is white text over red background.
Returns:
NIL
Description:
A good way to display information messages during the running
of an application is to send them all to the SAME line on the
screen where users are expected to look for them. In order to
give users a chance to read the current message before the next one
is displayed we may need to insert a delay after each message.
FT_PENDING() function displays messages by keeping track of
the time of the last message and providing a delay ONLY if the next
pending message is issued much too soon after the current one.
Examples:
FT_PENDING("Message one",20,0,3,"W+/G") // Displays "Message one."
// sets row to 20, col to 0.
// wait to 3 and color to
// bright white over green.
FT_PENDING("Message two") // Displays "Message two", after 5 sec.
FT_PENDING("Message three") // Displays "Message three", after 5 sec.
Note that default row, col, wait time and color need to be set only
once in the very first call to FT_PENDING() and only if the internal
default values are not appropriate.
Status:
Compliance:
Files:
See also:
FT_PICKDAY()
Lang:
pickday.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\pickday.txt
Template:
Category:
Menus/Prompts
Subcategory:
Oneliner:
Picklist of days of week
Syntax:
FT_PICKDAY() -> cDayOfWeek
Arguments:
None
Returns:
Character string containing day of week
Description:
This function is ideal if you need the user to select a day.
Examples:
mday := FT_PICKDAY()
Status:
Compliance:
Files:
See also:
FT_POKE()
Lang:
poke.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\poke.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Write a byte to a specified memory location
Syntax:
FT_POKE( , , ) -> lResult
Arguments:
is the segment of the desired memory address.
is the offset of the desired memory address.
is the value to write to the desired memory address.
Returns:
will be .T. if all parameters were valid and the function was
able to write the desired byte.
will be .F. if invalid parameters were passed.
Description:
Use this function if you have a need to change the value at a specific
memory location. The function will write the specified byte to the
specified address. The value must be passed as a numeric; if the byte
you wish to use is stored as a character, use the Asc() function
to convert it.
This function was written for version 5.1 of MicroSoft C. You may
have to modify the source code to use another compiler.
Examples:
FT_POKE( 0, 1047, 64) // Turn CapsLock on
Status:
Compliance:
Files:
See also:
FT_POPVID()
Lang:
pvid.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\pvid.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Restore previously saved video states.
Syntax:
FT_PopVid() ->
Arguments:
None
Returns:
The number of items remaining in the internal stack.
Description:
This is the complementary function to FT_PushVid(). At some time
after saving the video states it will probably be necessary to restore
them. This is done by restoring the settings from the last call to
FT_PushVid(). The number of items on the internal stack is then
reduced by one. Note that the use of stack logic means that items on
the stack are retrieved in Last In First Out order.
is the row at which the prompt is to appear.
is the column at which the prompt will appear.
is the menu item string.
is optional and is the color attribute of the prompt. Note
that two colors are required; one for the standard setting and one
for the enhanced setting (i.e. the light bar color). See the example
below if this isn't clear. If is not specified then the
current SetColor() value is used by default.
is optional and is the message associated with the
prompt. If not specified, then no message will be displayed.
is optional and is the row at which the message, if any,
will appear. If not specified, the default is the current setting
of the SET MESSAGE TO command.
is optional and is the column at which the message, if
any, will appear. If not specified, the default is either zero or
centered, depending on the current setting of the CENTER option of
the SET MESSAGE TO command.
is optional and is the color attribute of the message.
If not specified, the default is the same as the prompt color.
is optional and is the position within the prompt string
where the trigger character is located. If not specified, the
default is one.
is optional and is the color attribute of the trigger
character. Note that two colors are required; one for the standard
setting and one for the enhanced setting (i.e. the light bar color).
See the example below if this isn't clear. If is not
specified then the default is the same color as the rest of the
prompt.
is optional and specifies which prompt becomes active
when the home key is pressed. If not specified, the default is
the first prompt.
is optional and specifies which prompt becomes active
when the end key is pressed. If not specified, the default is
the last prompt.
is optional and specifies which prompt becomes active
when the up arrow key is pressed. If not specified, the
default is the previous prompt. The current setting of SET
WRAP TO is obeyed.
is optional and specifies which prompt becomes
active when the down arrow key is pressed. If not
specified, the default is the next prompt. The current
setting of SET WRAP TO is obeyed.
is optional and specifies which prompt becomes
active when the right arrow key is pressed. If not
specified, the default is the next prompt. The current
setting of SET WRAP TO is obeyed.
is optional and specifies which prompt becomes
active when the left arrow is pressed. If not specified,
the default is the previous prompt. The current setting of
SET WRAP TO is obeyed.
is optional and is a code block to evaluate whenever
the menu item to which it belongs is selected.
Returns:
Description:
Clipper's @...PROMPT and MENU TO commands are fine as far as
they go. But many times you need more flexibility. As
you'll no doubt notice if you read the argument list, this
function is almost completely flexible. You can adjust
locations and colors for every part of the prompt and its
associated message. In addition, since you can control the
effect of the arrow keys, you can allow both horizontal and
vertical movement, or even disable certain arrow keys if you
so desire. Support for nested menus is also available, since
the prompts are stored in stack-based static arrays.
Note that this command can also be called using function-style
syntax. See the entry for FT_PROMPT() for further details.
This enhanced version of @...PROMPT requires the inclusion of
the header file ftmenuto.ch in any source file that uses it.
It is may be used in place of the standard Clipper @...PROMPT
command. However, in the interests of functionality it is NOT
100% compatible. No whining! If compatibility is such a big
deal then use the standard Clipper commands.
Examples:
#include "ftmenuto.ch"
// Simple prompt
@ 1, 1 PROMPT "Menu choice #1"
// Prompt with color
@ 3, 1 PROMPT "Menu choice #2" COLOR "W+/R,W+/B"
// Prompt with a message
@ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch"
// Prompt with pinpoint message control
@ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ;
MSGROW 22 MSGCOL 4 MSGCOLOR "GR+/N"
// Prompt with a trigger character ("#" character)
@11, 1 PROMPT "Menu choice #6" TRIGGER 13
// Prompt with trigger character color control
@13, 1 PROMPT "Menu Choice #7" TRIGGER 13 TRIGGERCOLOR "R+/BG,G+/N"
// Prompt with right and left arrow keys disabled
@15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8
Status:
Compliance:
Files:
See also:
FT_PROPER()
Lang:
proper.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\proper.txt
Template:
Category:
String
Subcategory:
Oneliner:
Convert a string to proper-name case
Syntax:
FT_PROPER( ) -> cProperName
Arguments:
is the string to be converted.
Returns:
A string of the same length as , only converted to
proper name case (upper/lower case).
Description:
FT_PROPER() uses a brute-force algorithm to convert a string
to propername case. First, it capitalizes the first letter of
all words starting after a blank, dash, or apostrophe. This
catches most names, including special cases such as names
beginning with O' (O'Malley, O'Reilly) and hyphenated names
(such as Susan Chia-Mei Lo).
Next, it does a specific adjustment for words beginning in "Mc"
It finds the first 'Mc' and capitalizes the next character after
it. It does this for all occurrences of Mc.
The original FT_PROPER() was written in Clipper by Glenn Scott
and Mark Zechiel; it was re-written in C (and thus, optimized
and enhanced) by Robert DiFalco.
set to .T. will enable the Print Screen key,
.F. will disable it. If omitted, leaves status as is.
Returns:
The current state: .T. if enabled, .F. if disabled.
Description:
This function is valuable if you have a need to disable the
printscreen key. It works by fooling the BIOS into thinking that
a printscreen is already in progress. The BIOS will then refuse
to invoke the printscreen handler.
Examples:
FT_PRTSCR( .F. ) && Disable the printscreen key
FT_PRTSCR( .T. ) && Enable the printscreen key
MemVar := FT_PRTSCR() && Get the current status
The current size of the internal stack (i.e. the number of times
FT_PushVid() has been called).
Description:
Menus, picklists, browses, and other video-intensive items often
require you to save certain video states -- screen image, cursor
position, and so forth. Constantly saving and restoring these items
can get very tedious. This function attempts to alleviate this
problem. When called, it saves the cursor position, color setting,
screen image, cursor style, blink setting, scoreboard setting, snow
setting, and maximum row and column to a series of static arrays. All
that is needed to restore the saved settings is a call to FT_PopVid().
Examples:
FT_PushVid() // Save the current video states
Status:
Compliance:
Files:
See also:
FT_PopVid()
FT_PUTKEY()
Lang:
putkey.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\putkey.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Stuff a keystroke into the keyboard buffer
Syntax:
FT_PUTKEY( ) -> lResult
Arguments:
is the INKEY() value of the keystroke to be stuffed.
Returns:
.T. if the keystroke was put into the keyboard buffer.
.F. if nKeyValue was invalid or the buffer was full.
Description:
This function is similar to the KEYBOARD command, with a few
exceptions. First, this function does not clear the keyboard buffer
before inserting the keystroke. In addition, since it uses the
Inkey() value, you can stuff any key, including function keys, into
the keyboard buffer. However, this also means that unlike the KEYBOARD
command, you can only stuff one keystroke at a time.
You can easily create a User-Defined Command that makes this function
even more like the KEYBOARD command. For example,
#command KEYSTROKE => FT_PUTKEY( )
will create a command called KEYSTROKE that could be used as a
companion command to KEYBOARD. The only difference is that it would
insert a single keystroke instead of a string.
Be aware that this function makes use of Clipper's internal event
handler. If you don't like using internals, then don't use this
function, you sniveling coward.
This function is written to adhere to Turbo Assembler's IDEAL mode.
To use another assembler, rearrange the SEGMENT and PROC directives
and make any other necessary changes to the source code.
Examples:
FT_PUTKEY( -9 ) // Stuff the F10 key
FT_PUTKEY( 276 ) // Stuff the Alt T key
KEYSTROKE 28 // Stuff the F1 key using a User-Defined Command
Status:
Compliance:
Files:
See also:
FT_QTR()
Lang:
qtr.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\qtr.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Return Calendar or Fiscal Quarter Data.
Syntax:
FT_QTR( [ ], [ ] ) -> aDateInfo
Arguments:
is any valid date in any date format. Defaults
to current system date if not supplied.
is a number from 1 to 4 signifying a quarter.
Defaults to current quarter if not supplied.
Returns:
A three element array containing the following data:
aDateInfo[1] - The year and quarter as a character string "YYYYQQ"
aDateInfo[2] - The beginning date of the quarter
aDateInfo[3] - The ending date of the quarter
Description:
FT_QTR() returns an array containing data about the quarter
containing the given date.
Normally the return data will be based on a year beginning
on January 1st with weeks beginning on Sunday.
The beginning of year date and/or beginning of week day can be
changed by using FT_DATECNFG(), which will affect all subsequent
calls to FT_QTR() until another call to FT_DATECNFG().
The beginning of year date and beginning of week day may be reset
to January 1 and Sunday by calling FT_DATECNFG() with no
parameters.
Examples:
// get info about quarter containing 9/15/90
aDateInfo := FT_QTR( CTOD("09/15/90") )
? aDateInfo[1] // 199003 (3rd quarter)
? aDateInfo[2] // 07/01/90 beginning of quarter 3
? aDateInfo[3] // 09/30/90 end of week quarter 3
// get info about quarter 2 in year containing 9/15/90
aDateInfo := FT_QTR( CTOD("09/15/90"), 2 )
? aDateInfo[1] // 199002
? aDateInfo[2] // 04/01/90 beginning of quarter 2
? aDateInfo[3] // 06/30/90 end of quarter 2
// get info about quarter 2 in current year (1991)
aDateInfo := FT_QTR( , 2 )
? aDateInfo[1] // 199102
? aDateInfo[2] // 04/01/91 beginning of quarter 2
? aDateInfo[3] // 06/30/91 end of quarter 2
Status:
Compliance:
Files:
See also:
FT_DATECNFG() FT_WEEK() FT_MONTH() FT_YEAR()
FT_RAND1()
Lang:
rand1.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\rand1.txt
Template:
Category:
Math
Subcategory:
Oneliner:
Generate a random number
Syntax:
FT_RAND1( ) -> nRand
Arguments:
Maximum limit of value to be produced.
Returns:
nRand is a random number between 0 (inclusive) and (exclusive).
Description:
Generates a non-integer random number based on the Linear
Congruential Method.
If you need a random number between 1 and inclusive, INT()
the result and add 1.
If you need a random number between 0 and inclusive,
then you should ROUND() the result.
Find position of the reversed nth occurrence of a substring
Syntax:
FT_RAT2( , [, [, ] ] ) -> nPos
Arguments:
is the character substring to search for.
is the character string to search.
is the occurrence of cSearch to look for,
defaults to 1.
is a logical value denoting case sensitivity.
If .F., then search is NOT sensitive to case,
defaults to .T.
Returns:
The position of the nth occurrence of a reversed substring
Description:
This function will find the nth occurrence of a reversed
substring within a string.
Examples:
cSearch := "t"
cTarget := "This is the day that the Lord has made."
FT_RAT2( cSearch, cTarget ) // Returns ( 22 )
FT_RAT2( cSearch, cTarget, 2 ) // Returns ( 20 )
FT_RAT2( cSearch, cTarget, 2, .F. ) // Returns ( 22 )
Status:
Compliance:
Files:
See also:
FT_FINDITH(), FT_AT2()
FT_RESTARR()
Lang:
savearr.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\savearr.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Restore a Clipper array from a disc file
Syntax:
FT_RESTARR( , ) -> aArray
Arguments:
is a DOS file name.
will return any DOS file error.
All arguments are required.
Returns:
Return an array variable.
Description:
FT_RESTARR() restores an array which was saved to
a disc file using FT_SAVEARR().
[10/1/92 Librarian note:
This function does not appear to work with multi-dimensional
arrays. If you'd care to modify it to support this feature,
please do and send it to Glenn Scott 71620,1521.]
Restore the attribute bytes of a specified screen region.
Syntax:
FT_RESTATT( , , , , ) -> NIL
Arguments:
, , , and define the screen region.
is a character string containing the attribute bytes
for the screen region. This will most often be a string
previously returned by FT_SAVEATT(), but any character
string may be used (provided it is of the proper size).
Returns:
NIL
Description:
This function is similar to Clipper's RestScreen(), except that it only
restores the attribute bytes. This is useful if you want to change the
screen color without affecting the text.
*** INTERNALS ALERT ***
This function calls the Clipper internals __gtSave and __gtRest to
manipulate the the screen image. If you're too gutless to use
internals, then this function isn't for you.
Examples:
// Restore attributes of row 4
FT_RESTATT( 4, 0, 4, maxcol(), cBuffer)
// Restore attributes to middle of screen
FT_RESTATT(10,20,14,59,cBuffer)
Status:
Compliance:
Files:
See also:
FT_SAVEATT()
FT_RESTSETS()
Lang:
restsets.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\restsets.txt
Template:
Category:
Environment
Subcategory:
Oneliner:
Restore status of all SET command settings
Syntax:
FT_RESTSETS( [ ] ) -> NIL
Arguments:
aOldSets is an array of SET settings created by FT_SAVESETS()
Returns:
NIL
Description:
This function "restores" the SET Settings, i.e., it sets them to the
values in the array aOldSets. The following SETs are not currently
supported: FILTER, FORMAT, FUNCTION, INDEX, KEYS, MODE, ORDER,
PROCEDURE, RELATION, TYPEAHEAD
Examples:
FT_RESTSETS(aOldSets)
Status:
Compliance:
Files:
See also:
FT_SAVESETS() FT_SETCENTURY()
FT_RGNSTACK()
Lang:
scregion.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\scregion.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Push or pop a saved screen region on or off the stack
Syntax:
FT_RGNSTACK( , [ ], [ ], [ ],
[ ] ) -> NIL
Arguments:
determines what action FT_RGNSTACK() will take. The
allowable values for this parameter are "push", "pop", and "pop all".
If the function is called with any other string as the first parameter
no action is performed.
with a value of "push" will push a saved screen region onto
the stack. A value of "pop" will restore the most recently pushed
screen region. "pop all" tells the function to restore all screen
images which are currently on the stack.
The use of , , , and depends on the
parameter. If is "push", the next four parameters
define the screen region to save. If is "pop" or "pop all"
the following four parameters are ignored.
Returns:
FT_RGNSTACK() returns NIL.
Description:
FT_RGNSTACK() allows multiple screens to be saved and restored from
a stack. The stack is implemented with Clipper static array that is
visible only to FT_RGNSTACK().
The purpose of FT_RGNSTACK() is to allow multiple screen regions to be
managed without the need to remember the original coordinates or to
create variables for each one.
When called with "push", FT_RGNSTACK() places the saved screen area
at the end of the static array. The array size is incremented by one
to accommodate the new screen area.
When called with "pop", the function restores the screen image stored
in the last element of the array, and the array size is decremented by
one. If "pop all" is specified, all the saved screens are restored
until the array is empty.
FT_RGNSTACK() calls FT_SAVRGN() and FT_RSTRGN(). Refer to the
documentation for these two functions for more information.
Examples:
The following example uses FT_RGNSTACK() to save and restore various
sections of the screen.
@ 00, 00, 24, 79 BOX "111111111" // fill the screen with 1's
FT_RGNSTACK("push", 10, 05, 15, 15) // push a region
@ 00, 00, 24, 79 BOX "222222222" // fill the screen with 2's
FT_RGNSTACK("push", 10, 20, 15, 30) // push a region
@ 00, 00, 24, 79 BOX "333333333" // fill the screen with 3's
FT_RGNSTACK("push", 10, 35, 15, 45) // push a region
@ 00, 00, 24, 79 BOX "444444444" // fill the screen with 4's
FT_RGNSTACK("push", 10, 50, 15, 60) // push a region
@ 00, 00, 24, 79 BOX "555555555" // fill the screen with 5's
FT_RGNSTACK("push", 10, 65, 15, 75) // push a region
CLEAR
FT_RGNSTACK("pop") // restore the 5's region
FT_RGNSTACK("pop") // restore the 4's region
FT_RGNSTACK("pop all") // restore the 3's, 2's and 1's regions
Status:
Compliance:
Files:
See also:
FT_SAVRGN() FT_RSTRGN()
FT_RMDIR()
Lang:
rmdir.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\rmdir.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Delete a subdirectory
Syntax:
FT_RMDIR( ) -> nResult
Arguments:
is the name of the directory to delete.
Returns:
0 if successful
3 if Path Not Found
5 if Access Denied (directory not empty)
16 if attempt to delete current directory.
99 if invalid parameters passed
Description:
This function is useful if you need to remove a subdirectory for
some reason.
The source code is written to adhere to Turbo Assembler's IDEAL mode.
To use another assembler, you will need to rearrange the PROC and
SEGMENT directives, and also the ENDP and ENDS directives (a very
minor task).
is the number to round
is the fraction to round to or the number of places,
default is 2.
is the type of rounding desired
"D" for Decimal (3 for thousandth, 1/1000) (default)
"F" for Fraction (3 for thirds, 1/3)
"W" for Whole numbers (3 for thousand, 1000)
is the direction to round the number toward
"U" to round Up 1.31 -> 1.4
-1.31 -> -1.4
"D" to round Down 1.36 -> 1.3
-1.36 -> -1.3
"N" to round Normal 1.5 -> 2
-1.5 -> -2
1.49 -> 1
-1.49 -> -1
is the amount that is considered acceptable
to be within, i.e., if you're within this amount of the number
you don't need to round
Returns:
The number, rounded as specified.
Description:
This function will allow you to round a number. The following can
be specified:
a. Direction (up, down or normal - normal is 4/5 convention)
b. Type (whole, decimal, fraction)
c. Amount (100's, 5 decimals, 16th, etc.)
Examples:
// round normal to 2 decimal places
nDollars := FT_ROUND(nDollars)
// round normal to 6 decimal places
nIntRate := FT_ROUND(nIntRate, 6)
// round to nearest thousands
nPrice := FT_ROUND(nPrice, 3, NEAREST_WHOLE_NUMBER)
// round Up to nearest third
nAmount := FT_ROUND(nAmount, 3, NEAREST_FRACTION, ROUND_UP)
// round down to 3 decimals Within .005
nAvg := FT_ROUND(nAvg, 3, , ROUND_DOWN, .005)
Status:
Compliance:
Files:
See also:
FT_RSTRGN()
Lang:
scregion.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\scregion.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Restore region of the screen saved with FT_SAVRGN()
Syntax:
FT_RSTRGN( , [ ], [ ] ) -> NIL
Arguments:
is a screen region previously returned from FT_SAVRGN().
and are optional parameters that define a new location
for the upper left corner of the screen area contained in .
Allowable values are 0 through 255.
Returns:
FT_RSTRGN() returns NIL.
Description:
FT_RSTRGN() restores a screen region previously saved with
FT_SAVRGN(). Calling FT_RSTRGN() with as the only
parameter will restore the saved region to its original location.
and may be used to define a new location for the
upper left corner of the saved region.
and are dependent upon each other. You may not
specify one without the other.
FT_RSTRGN() calls Clipper's RESTSCREEN(). Refer to the Clipper
documentation for more information regarding this function.
Examples:
The following example uses FT_RSTRGN() to restore a saved portion
of the screen to different locations.
@ 00, 00, 24, 79 BOX "111111111" // fill the screen with 1's
cScreen = FT_SAVRGN(10, 10, 20, 30) // save a region
@ 00, 00, 24, 79 BOX "222222222" // fill the screen with 2's
FT_RSTRGN(cScreen) // restore the 1's region
@ 00, 00, 24, 79 BOX "222222222" // fill the screen with 2's
FT_RSTRGN(cScreen, 15, 15) // restore to a different location
@ 00, 00, 24, 79 BOX "222222222" // fill the screen with 2's
FT_RSTRGN(cScreen, 20, 60) // restore to a different location
Status:
Compliance:
Files:
See also:
FT_SAVRGN() FT_RGNSTACK()
FT_SAVEARR()
Lang:
savearr.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\savearr.txt
Template:
Category:
Array
Subcategory:
Oneliner:
Save Clipper array to a disc file.
Syntax:
FT_SAVEARR( , , ) -> lRet
Arguments:
is any Clipper array except those containing
compiled code blocks.
is a DOS file name.
will return any DOS file error.
All arguments are required.
Returns:
.F. if there was a DOS file error or the array contained
code blocks, otherwise returns .T.
Description:
FT_SAVEARR() saves any Clipper array, except those
containing compiled code blocks, to a disc file. The
array can be restored from the disc file using
FT_RESTARR().
[10/1/92 Librarian note:
This function does not appear to work with multi-dimensional
arrays. If you'd care to modify it to support this feature,
please do and send it to Glenn Scott 71620,1521.]
Save the attribute bytes of a specified screen region.
Syntax:
FT_SAVEATT( , , , ) -> cAttributes
Arguments:
, , , and define the screen region.
Returns:
A character string containing the screen attribute bytes for the
specified region. If the memory to store the return value could
not be allocated, the function returns NIL.
Description:
This function is similar to Clipper's SaveScreen(), except that it only
saves the attribute bytes. This is useful if you want to change the
screen color without affecting the text.
*** INTERNALS ALERT ***
This function calls the Clipper internal __gtMaxCol to obtain the
maximum column value for the current video mode. If you're too gutless
to use internals, then this function isn't for you.
Examples:
// Save attributes of row 4
cBuffer := FT_SAVEATT( 4, 0, 4, maxcol())
// Save attributes from middle of screen
cBuffer := FT_SAVEATT(10,20,14,59)
Status:
Compliance:
Files:
See also:
FT_RESTATT()
FT_SAVESETS()
Lang:
savesets.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\savesets.txt
Template:
Category:
Environment
Subcategory:
Oneliner:
Save the status of all the SET command settings
Syntax:
FT_SAVESETS() -> aOldSets
Arguments:
None
Returns:
An array containing the values of the supported SETs.
Description:
This function saves the SET Settings, i.e., it copies them into an
array, aOldSets. The following SETs are not currently supported:
FILTER, FORMAT, FUNCTION, INDEX, KEYS, MODE, ORDER, PROCEDURE,
RELATION, TYPEAHEAD
Examples:
aOldSets := FT_SAVESETS()
Status:
Compliance:
Files:
See also:
FT_RESTSETS() FT_SETCENTURY()
FT_SAVRGN()
Lang:
scregion.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\scregion.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Save a screen region for later display
Syntax:
FT_SAVRGN( , , , ) -> cScreen
Arguments:
, , , and define the portion of the
screen to save. Allowable values are 0 through 255.
Returns:
FT_SAVRGN() returns the saved screen region and its coordinates
as a character string.
Description:
FT_SAVRGN() is similar to Clipper's SAVESCREEN(), but it saves the
screen coordinates as well as the display information. The saved
area can be restored by passing the returned string to FT_RSTRGN().
Note that the strings returned from FT_SAVRGN() and Clipper's
SAVESCREEN() are not interchangeable. A screen region saved with
with FT_SAVRGN() must be restored using FT_RSTRGN().
FT_SAVRGN() calls Clipper's SAVESCREEN(). Refer to the Clipper
documentation for more information regarding this function.
Examples:
The following example uses FT_SAVRGN() and FT_RSTRGN() to save
and restore a portion of the screen.
@ 00, 00, 24, 79 BOX "111111111" // fill the screen with 1's
cScreen = FT_SAVRGN(10, 10, 20, 30) // save a region
@ 00, 00, 24, 79 BOX "222222222" // fill the screen with 2's
FT_RSTRGN(cScreen) // restore the 1's region
Status:
Compliance:
Files:
See also:
FT_RSTRGN() FT_RGNSTACK()
FT_SCANCODE()
Lang:
scancode.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\scancode.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Wait for keypress and return keyboard scan code
Syntax:
FT_SCANCODE() -> cCode
Arguments:
None
Returns:
A two-character string, corresponding to the keyboard scan code.
Description:
FT_SCANCODE() enables you to distinguish the different scancodes
of similar keys (such as Grey minus versus regular minus), thus
increasing the number of keys your input routine can recognize.
It works like INKEY(), in that it waits for a key to be pressed.
The scan code consists of two bytes, which are returned as a
two-character string.
For example, calling FT_SCANCODE() and pressing the Grey-minus
key will return a two character string:
CHR(45) + CHR(74)
LASTKEY() is not updated by FT_SCANCODE(), so don't try to
test LASTKEY() to see what was pressed during an FT_SCANCODE()
call. Simply assign the return value to a variable and test
that (see the test driver below).
* This was adapted from a short C routine posted by John Kaster on
NANFORUM. It was written in Clipper to help demonstrate the
FT_INT86 function of the Nanforum Toolkit.
This program requires FT_INT86().
lNewSetState - Boolean to Set CENTURY
.F. - Toggle CENTURY off
.T. - Toggle CENTURY on
If not specified, leave CENTURY as is
Returns:
The state of the CENTURY setting upon entry to the routine
Description:
This function returns the state (ON/OFF, TRUE/FALSE) of the CENTURY
and optionally sets it ON or OFF.
Examples:
lOldState := FT_SETCENTURY() // Get current CENTURY Setting
lOldState := FT_SETCENTURY(.T.) // Get the current CENTURY Setting
// and turn it on (set it to TRUE)
lOldState := FT_SETCENTURY(.F.) // Get the current CENTURY Setting
// and turn it off (set it to FALSE)
Status:
Compliance:
Files:
See also:
FT_SETDATE()
Lang:
setdate.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\setdate.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Set the DOS system date
Syntax:
FT_SETDATE( ) ->
Arguments:
is a Clipper date variable that you want to set the current
DOS system date to.
It is up to you to send in a valid date. The
year must be within the range 1980 through 2099. If DOS
thinks the date is not valid, it won't change the date.
Returns:
is simply the result of FT_INT86(), passed back
to your program.
Description:
FT_SETDATE() uses NANFOR.LIB's FT_INT86() function to invoke
the DOS Set Date service (Interrupt 33, service 43).
Examples:
The following program takes a date from the command line and sets
the DOS system date:
FUNCTION main( cDate )
cDate := iif( cDate == nil, dtoc( date() ), cDate )
QOut( "Setting date to: " + cDate + "... " )
FT_SETDATE( ctod( cDate ) )
Qout( "Today is now: " + dtoc( date() ) )
RETURN NIL
Status:
Compliance:
Files:
See also:
FT_SETMODE()
Lang:
vidmode.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\vidmode.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Set the video mode
Syntax:
FT_SETMODE( ) -> NIL
Arguments:
is one of the DOS video modes.
Returns:
NIL
Description:
Use this function to put your display adapter into a video mode.
Uses DOS interrupt 10h to set the mode. For a table of modes
available on various graphics adapters, refer to a book such
as Wilton's "Programmer's Guide to PC & PS/2 Video Systems"
(Microsoft Press)
This routine is used to adjust the IBM PC/AT and PS/2 "typematic"
repeat and delay feature. This is used to allow the users of your
application to adjust these speeds to the most comfortable level.
This source code is written for Microsoft Assembler v5.1.
Examples:
FT_SETRATE(0,0) // Set keyboard to fastest possible settings
FT_SETRATE() // Set keyboard to AT defaults (10.9cps,500ms delay)
FT_SETRATE(11,1) // Set keyboard to PS/2 defaults (10cps,500ms delay)
Status:
Compliance:
Files:
See also:
FT_SETTIME()
Lang:
settime.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\settime.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Set the DOS system time
Syntax:
FT_SETTIME( ) ->
Arguments:
is a string in the form that you want to set
the current DOS system time to.
Use 24-hour time. It is up to you to send in a valid time. If
DOS doesn't think it is valid, it won't reset the time anyway.
Returns:
is simply the result of FT_INT86(), passed back
to your program.
Description:
FT_SETTIME() uses NANFOR.LIB's FT_INT86() function to invoke
the DOS Set Time service (Interrupt 33, service 45).
Examples:
The following program takes a time string from the command line and sets
the DOS system time:
FUNCTION main( cTime )
cTime := iif( cTime == nil, time(), cTime )
QOut( "Setting time to: " + cTime + "... " )
FT_SETTIME( cTime )
Qout( "Time is now: " + time() )
RETURN NIL
Status:
Compliance:
Files:
See also:
FT_SETVCUR()
Lang:
vidcur.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\vidcur.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Set the cursor position on a specified video page
Syntax:
FT_SETVCUR( [ ], [ ], [ ] ) -> NIL
Arguments:
is the video page (defaults to current page, determined
by FT_GETVPG()
is the row coordinate (defaults to 0 )
is the column coordinate (defaults to 0 )
Returns:
NIL
Description:
FT_SETVCUR() sets the cursor position on a specific video page.
It uses FT_INT86() to invoke interrupt 10h, function 2.
For more information on graphics programming, cursors, and video
pages, refer to Richard Wilton's _Programmer's Guide to PC and
PS/2 Video Systems_ (Microsoft Press).
Examples:
// Set the position to row 5, column 10 on video page 1:
FT_SETVCUR( 1, 5, 10 )
Status:
Compliance:
Files:
See also:
FT_SETVPG()
Lang:
page.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\page.txt
Template:
Category:
Video
Subcategory:
Oneliner:
Set the current video page
Syntax:
FT_SETVPG( ) -> NIL
Arguments:
is a valid video page.
Returns:
NIL
Description:
Selects the video page.
For more information on graphics programming and video pages,
consult a reference such as "Programmer's Guide to PC and PS/2
Video Systems" (Microsoft Press).
Examples:
// The following sets the current video page to 1
FT_SETVPG( 1 )
Status:
Compliance:
Files:
See also:
FT_GETVPG()
FT_SHIFT()
Lang:
shift.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\shift.txt
Template:
Category:
Keyboard/Mouse
Subcategory:
Oneliner:
Determine status of shift key
Syntax:
FT_SHIFT() -> lValue
Arguments:
None
Returns:
.T. if a shift key is pressed, .F. if otherwise.
Description:
This function is useful for times you need to know whether or not the
shift key is pressed, such as during a MemoEdit().
Examples:
IF FT_SHIFT()
@24, 0 say "Shift"
ELSE
@24, 0 say " "
ENDIF
Replacement for INKEY() that tests for SET KEY procedures
Syntax:
FT_SINKEY( [ ] ) -> nKey
Arguments:
is the number of seconds to wait. If zero,
FT_SINKEY() will wait indefinitely for a keypress. If not
passed, FT_SINKEY() does not wait for a keypress. If NIL,
it is treated the same as 0.
Returns:
The INKEY() value of the key pressed.
Description:
FT_SINKEY() is similar to the function provided by Nantucket in
keyboard.prg, with one significant difference: you can pass NIL
to INKEY(), which will be treated as a zero (i.e., wait indefinitely
for keypress). Therefore, it is necessary to differentiate between
an explicit NIL and one that is a result of a formal parameter NOT
being received.
FT_SINKEY() differs from the standard INKEY() in that it will
respond to any keys set with SET KEY TO or SetKey().
Examples:
SetKey( K_F1, {|n,l,r| Help(n,l,r) } )
nKey := FT_SINKEY(0) // Help() will be called if F1 pressed
Status:
Compliance:
Files:
See also:
FT_SLEEP
Lang:
sleep.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\sleep.txt
Template:
Category:
Menus/Prompts
Subcategory:
Oneliner:
Wait for a specified amount of time
Syntax:
FT_SLEEP( , [] ) -> nil
Arguments:
is the number of seconds to pause
is an optional clock value (from a call to SECONDS())
from which the seconds are to elapse. Useful
for setting a minimum time between the start of events
which could take a variable amount of time due to the
execution of intervening code.
Returns:
NIL
Description:
This routine will wait a specified period of time. It provides
resolution based upon the execution of the SECONDS() function.
It does not use an input state such as INKEY(). The specified time
is the minimum time sleeping and will usually be slightly longer.
The second optional argument allows one to begin timing an event
prior to executing some operation. This is useful when, for example,
you input a key or mouse click and wish to do something but still want
to note if the user double entered (mouse or key) within a certain time
which in turn may have meaning within your program's context.
The routine correctly handles passing through midnight but will not
work for more than 24 hours.
Examples:
Example 1:
FT_SLEEP(10.0) // Sleep for 10.0 seconds
Example 2:
nTime := SECONDS() // usually after some interupt from mouse or
// keyboard
... intervening code ...
FT_SLEEP(0.5, nTime) // Sleep until the sytem clock is
// nTime+0.5 seconds.
Status:
Compliance:
Files:
See also:
FT_SQZN()
Lang:
sqzn.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\sqzn.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Compress a numeric value into a character string
Syntax:
FT_SQZN( [, [, ] ] ) -> cCompressed
Arguments:
nValue - The numeric value to be compressed
nSize - Optional size of numeric field, defaults to 10
nDecimals - Optional number of decimal places, defaults to 0
Returns:
cCompressed - Compressed string, 50% the size of nSize
Description:
The FT_SQZN function allows a numeric value to be compressed when
stored in the database. The compression is 50% the storage space
of the original number. The companion function, FT_UNSQZN returns
the original number from the compressed string.
Examples:
replace TRANS->cust_id with FT_SQZN(mcust_id,8),;
TRANS->amount with FT_SQZN(mamount,12,2)
Status:
Compliance:
Files:
See also:
FT_UNSQZN()
FT_STOD()
Lang:
stod.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\stod.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Convert a date string to a Clipper date data type
Syntax:
FT_STOD( ) -> dDateType
Arguments:
is a Clipper string in the format "CCYYMMDD".
Returns:
A Clipper date type.
Description:
This function allows the programmer to hard code a date into the
program without knowing what the current date type is. This
function is the converse of the Clipper DTOS() function.
Examples:
LOCAL dMyDate
dMyDate := FT_STOD( "19901127" )
Status:
Compliance:
Files:
See also:
FT_SYS2MIL()
Lang:
miltime.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\miltime.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Convert system time to military time format.
Syntax:
FT_SYS2MIL() -> cMILTIME
Arguments:
none
Returns:
character string of form hhmm, where 0<=hh<24.
Description:
Return current system time as character string in military format.
Examples:
FT_SYS2MIL() -> 1623
Status:
Compliance:
Files:
See also:
FT_MIL2CIV() FT_CIV2MIL()
FT_SYSMEM()
Lang:
sysmem.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\sysmem.txt
Template:
Category:
DOS/BIOS
Subcategory:
Oneliner:
Determine the amount of conventional memory installed
Syntax:
FT_SYSMEM() -> nMemSize
Arguments:
None
Returns:
A numeric corresponding to the number of K memory.
Description:
FT_SYSMEM() simply reports the amount of conventional memory
(up to 640K) installed.
FT_SYSMEM() uses DOS interrupt 12h to get this information.
For information, refer to Peter Norton's _Programmer's Guide
to the IBM PC_ (Brady).
is the directory where you want to create the temporary
file. If you omit this argument, the root of the current drive
is assumed ("\").
If is .T., then the file will be created with the hidden
attribute set. The default is .F.
Returns:
should be your path, including the name of the newly
created unique file. Use this with FOPEN(), etc.
If a DOS error occurred when trying to create the file, a
null string will be returned.
Description:
This function uses DOS Interrupt 21, service 5Ah (Create temporary
file) to create a unique filename in a directory you specify.
There will be no extension. After the file is created, you may
then fopen() it and do any i/o you need (see the test driver
in the source code).
This function requires FT_INT86().
Examples:
Create a unique file in the root of the current drive:
myFile := FT_TEMPFIL()
Create a unique file in the current directory and hide it:
myFile := FT_TEMPFIL(".\", .t.)
Create a unique file on another drive, but do not hide it:
myFile := FT_TEMPFIL("E:\nanfor\src\")
Status:
Compliance:
Files:
See also:
FT_UNSQZN()
Lang:
sqzn.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\sqzn.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Uncompress a numeric compressed by FT_SQZN()
Syntax:
FT_UNSQZN( , [, ] ) -> nValue
Arguments:
- Compressed string, obtained from FT_SQZN()
- Size of numeric field
- Optional number of decimal places
Returns:
nValue - Uncompressed numeric value
Description:
The FT_UNSQZN function returns the numeric value from the compressed
string. The compression is 50% the storage space of the original
number. The original number must have been compressed using the
FT_SQZN() function.
This function, along with FT_SQZN() can be used to reduce disk storage
requirements for numeric fields in a database file.
is any valid date in any date format. Defaults
to current system date if not supplied.
is a number from 1 to 53 signifying a week.
Defaults to current week if not supplied.
Returns:
A three element array containing the following data:
aDateInfo[1] - The year and week as a character string "YYYYWW"
aDateInfo[2] - The beginning date of the week
aDateInfo[3] - The ending date of the week
Description:
FT_WEEK() returns an array containing data about the week
containing the given date.
Normally the return data will be based on a year beginning
on January 1st with weeks beginning on Sunday.
The beginning of year date and/or beginning of week day can be
changed by using FT_DATECNFG(), which will affect all subsequent
calls to FT_WEEK() until another call to FT_DATECNFG().
The beginning of year date and beginning of week day may be reset
to January 1 and Sunday by calling FT_DATECNFG() with no
parameters.
Examples:
// get info about week containing 9/15/90
aDateInfo := FT_WEEK( CTOD("09/15/90") )
? aDateInfo[1] // 199037 (37th week)
? aDateInfo[2] // 09/09/90 beginning of week 37
? aDateInfo[3] // 09/15/90 end of week 37
// get info about week 25 in year containing 9/15/90
aDateInfo := FT_WEEK( CTOD("09/15/90"), 25 )
? aDateInfo[1] // 199025
? aDateInfo[2] // 06/17/90 beginning of week 25
? aDateInfo[3] // 06/23/90 end of week 25
// get info about week 25 in current year( 1991 )
aDateInfo := FT_WEEK( , 25 )
? aDateInfo[1] // 199025
? aDateInfo[2] // 06/16/91 beginning of week 25
? aDateInfo[3] // 06/22/91 end of week 25
is the beginning value for the date range.
is the ending value for the date range.
Returns:
The number of work days (Monday through Friday) between two dates.
Description:
FT_WORKDAYS() returns a number indicating the number of work days
between two dates. Work days are considered Monday through Friday.
(The five day work week none of us Clipper programmers have.)
Return numeric position of week within the year or NIL if
parameter does not conform.
Description:
Considers a full week as starting on Sunday, ending on Saturday.
First week of year (week 1) may start on any day, and thus
contain any number of days.
Final week of year (week 53) may contain any number of days.
Handles dates with CENTURY ON|OFF, to allow for 21st century.
Date validation must be external to this function.
Examples:
These code fragments find the week number, given a date.
// literal character date
dDate := CTOD("01/01/91")
nWkNum := FT_WOY(dDate) // result: 1
// presume DOS date to be 01/06/91
nWkNum := FT_WOY(DATE()) // result: 2
// date input
cDate := SPACE(8)
@ 4,10 get cDate PICT "##/##/##" // input 07/04/91
READ
nWkNum := FT_WOY(CTOD(cDate)) // result: 27
// last day of year
nWkNum := FT_WOY(CTOD("12/31/91")) // result: 53
For a demonstration of this function, compile and link the
program woy.prg in the Nanforum Toolkit source code.
is a character indicating the type of text justification.
"L" or "l" will cause the text to be left-justified in the box.
Centered text is the default.
is a character which determines if the function will wait
for a keypress after displaying the box. "W" or "w" will cause the
function to wait for a keypress before returning control to the
calling routine. Not waiting is the default
is a character which determines whether a single or double
border will be displayed. "D" or "d" will cause a double border to
be displayed. A single border is the default.
is a character string denoting the border color. 'N/W' is
the default if this parameter is not a string.
is a character string denoting the text color. 'W/N' is
the default if this parameter is not a string.
is a number denoting the starting row. If '99' is passed,
the box is centered vertically. If necessary, nStartRow is decreased
so the entire box can be displayed.
is a number denoting the starting column. If '99' is passed,
the box is centered horizontally. If necessary, nStartCol is decreased
so the entire box can be displayed.
thru are 1 to 8 character strings to be displayed.
They are truncated to fit on the screen if necessary.
Returns:
NIL
Description:
FT_XBOX() allows the programmer to display a message box on the screen
without needing to calculate the dimensions of the box. Only the upper
left corner needs to be defined. The function will calculate the lower
right corner based on the number and length of strings passed.
A maximum of eight strings can be displayed. If a string is too long
to fit on the screen it is truncated.
The first seven parameters are optional. The default settings are:
Lines of text are centered.
Control is returned to the calling routine immediately.
A single line border is painted.
The border is black on white.
The text is white on black.
The box is centered both vertically and horizontally.
WARNING: Shadowing is achieved by a call to FT_SHADOW(), an assembly
routine not found in this .prg. In order to use XBOX,
shadow.prg must also be present somewhere (if you are using
NANFOR.LIB, then it is).
Examples:
The following displays a two-line box with default settings:
FT_XBOX(,,,,,,,'This is a test','of the XBOX() function')
The following uses all optional parameters and displays a three-line
box. The box is left-justified with a double border. It has a yellow
on red border and white on blue text. The function will wait for a
keypress before returning control to the calling routine.
FT_XBOX('L','W','D','GR+/R','W/B',5,10,'It is so nice',;
'to not have to do the messy chore',;
'of calculating the box size!')
Status:
Compliance:
Files:
See also:
FT_XTOY()
Lang:
any2any.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\any2any.txt
Template:
Category:
Conversion
Subcategory:
Oneliner:
Convert from any data type to any other data type
Syntax:
FT_XTOY( , ;
[, ] ) -> xResult
Arguments:
is the value to convert.
is the type of value to convert to
("C","D","L","N","A" or "B").
is a logical to signal if 'Y' or 'N' is to be returned
if Converting a logical, otherwise '.T.' or '.F.' will be returned
for logicals.
Returns:
The original value converted to the new type.
Description:
This function converts a value of character, date, numeric, logical,
array or code block type to any of the other type. While it is
guaranteed to return a value of the correct type, that value may not
be meaningful (i.e., converting from a code block returns an EMPTY()
value of the desired type).
Examples:
nNumericValue := FT_XTOY(cInputValue, "N")
IF (FT_XTOY(nInputValue, "L"))
Status:
Compliance:
Files:
See also:
FT_YEAR()
Lang:
year.txt
Component:
hbnf
Doc. source:
hbnf\doc\en\year.txt
Template:
Category:
Date/Time
Subcategory:
Oneliner:
Return calendar or fiscal year data
Syntax:
FT_YEAR( [ ] ) -> aDateInfo
Arguments:
is any valid date in any date format. Defaults
to current system date if not supplied.
Returns:
A three element array containing the following data:
aDateInfo[1] - The year as a character string "YYYY"
aDateInfo[2] - The beginning date of the year
aDateInfo[3] - The ending date of the year
Description:
FT_YEAR() returns an array containing data about the year
containing the given date.
Normally the return data will be based on a year beginning
on January 1st.
The beginning of year date can be changed by using FT_DATECNFG(),
which will affect all subsequent calls to FT_YEAR() until another
call to FT_DATECNFG().
The beginning of year date may be reset to January 1 by calling
FT_DATECNFG() with no parameters.
Examples:
// Get info about year containing 9/15/90, assuming default
// beginning of year is January 1st.
aDateInfo := FT_YEAR( Ctod("09/15/90") )
? aDateInfo[1] // 1990
? aDateInfo[2] // 01/01/90 beginning of year
? aDateInfo[3] // 12/31/90 end of year
// get info about current year (1991).
aDateInfo := FT_YEAR()
? aDateInfo[1] // 1991
? aDateInfo[2] // 01/01/91 beginning of year
? aDateInfo[3] // 12/31/91 end of year
amount of money invested per period
rate of interest per period, 1 == 100%
period count
Returns:
Total value of the capital after of
paying and interest being
paid every period and added to the capital (resulting
in compound interest)
Description:
FV() calculates the value of a capital after periods.
Starting with a value of 0, every period,
(Dollars, Euros, Yens, ...) and an interest of for the
current capital are added for the capital (=Percent/100).
Thus, one gets the non-linear effects of compound interests:
value in period 0 = 0
value in period 1 = ((value in period 0)*(1+/100)) +
value in period 2 = ((value in period 1)*(1+/100)) +
etc....
value in period = ((value in period -1)*(1+/100))< +
= * sum from i=0 to -1 over (1+/100)^i
= * ((1+/100)^n-1) / (/100)
Examples:
// Payment of 1000 per year for 10 years at a interest rate
// of 5 per cent per year
? fv (1000, 0.05, 10) --> 12577.893
Status:
Ready
Compliance:
FV() is compatible with CT3's FV().
Files:
Source is finan.c, library is libct.
See also:
PV(),PAYMENT(),PERIODS(),RATE()
FWRITE()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Writes characters to a file.
Syntax:
FWRITE( , , [] ) --> nBytesWritten
Arguments:
DOS file handle number.
Character expression to be written.
The number of bytes to write.
Returns:
the number of bytes successfully written.
Description:
This function writes the contents of to the file designated
by its file handle . If used, is the number of
bytes in to write.
The returned value is the number of bytes successfully written to the
DOS file. If the returned value is 0, an error has occurred (unless
this is intended). A successful write occurs when the number returned
by FWRITE() is equal to either LEN( ) or .
The value of is the string or variable to be written to the
open DOS file .
The value of is the number of bytes to write out to the file.
The disk write begins with the current file position in . If
this variable is not used, the entire contents of is written
to the file.
To truncate a file, a call of FWRITE( nHandle, "", 0 ) is needed.
Examples:
nHandle := FCreate( "x.txt" )
FOR X := 1 TO 10
FWrite( nHandle, Str( x ) )
NEXT
FClose( nHandle )
Draws a partial ellipse centered at a given point.
Syntax:
gdImageArc( , , , , , , , ) --> NIL
Arguments:
- Image pointer
- center point horizontal position
- center point vertical position
- width
- height
- start degree
- end degree
- Color index
Returns:
NIL
Description:
gdImageArc() is used to draw a partial ellipse centered at the given point,
with the specified width and height in pixels. The arc begins at the position
in degrees specified by s and ends at the position specified by e.
The arc is drawn in the color specified by the last argument. A circle can be drawn
by beginning from 0 degrees and ending at 360 degrees, with width and height being equal.
must be greater than . Values greater than 360 are interpreted modulo 360.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw an ellipse
gdImageArc(pImage, 50, 25, 98, 48, 0, 360, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
Create a palette-based image in memory with no more that 256 colors.
Syntax:
gdImageCreate( , ) -->
Arguments:
- image width
- image height
Returns:
- Image pointer
Description:
gdImageCreate() creates an empty image in memory.
This image has no more than 256 colors.
gdImageCreate() returns an image pointer or NIL if unable to create the image.
The image pointer must be destroyed using gdImageDestroy()
Examples:
PROCEDURE Main()
LOCAL pImage
pImage := gdImageCreate( 64, 64 )
// Use here image
.........
gdImageDestroy( pImage )
RETURN
Status:
R
Compliance:
GD Library
Files:
gdwrp.c
See also:
gdImageDestroy(), gdImageCreateTrueColor()
gdImageCreateTrueColor()
Lang:
hbgd.txt
Component:
hbgd
Doc. source:
hbgd\doc\en\hbgd.txt
Template:
Category:
HBGD
Subcategory:
Oneliner:
Create a true color image in memory.
Syntax:
gdImageCreateTrueColor( , ) -->
Arguments:
- image width
- image height
Returns:
- Image pointer
Description:
gdImageCreateTrueColor() creates an empty image in memory.
This image has true colors.
gdImageCreateTrueColor() returns an image pointer or NIL if unable to create the image.
The image pointer must be destroyed using gdImageDestroy()
Examples:
PROCEDURE Main()
LOCAL pImage
pImage := gdImageCreateTrueColor( 64, 64 )
// Use here image
.........
gdImageDestroy( pImage )
RETURN
Status:
R
Compliance:
GD Library
Files:
gdwrp.c
See also:
gdImageDestroy(), gdImageCreate()
gdImageDashedLine()
Lang:
hbgd.txt
Component:
hbgd
Doc. source:
hbgd\doc\en\hbgd.txt
Template:
Category:
HBGD
Subcategory:
Oneliner:
Draws a dashed line between two end points (x1, y1 and x2, y2) with a particular color index.
Syntax:
gdImageDashedLine( , , , , , ) --> NIL
Arguments:
- Image pointer
- 1st point horizontal position
- 1st point vertical position
- 2nd point horizontal position
- 2nd point vertical position
- Color index
Returns:
NIL
Description:
gdImageDashedLine() Draws a dashed line between two end points (x1, y1 and x2, y2)
with a particular color index.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw a dashed line
gdImageDashedLine(pImage, 10, 10, 90, 90, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
gdImageDestroy() frees memory used from an image.
It's important to use this function before exiting from a program.
HBGD uses it's own memory to manage an image, so it is important to use this function.
Examples:
PROCEDURE Main()
LOCAL pImage
pImage := gdImageCreateTrueColor( 64, 64 )
// Use here image
.........
gdImageDestroy( pImage )
RETURN
Status:
R
Compliance:
GD Library
Files:
gdwrp.c
See also:
gdImageCreate(), gdImageCreateTrueColor()
gdImageFill()
Lang:
hbgd.txt
Component:
hbgd
Doc. source:
hbgd\doc\en\hbgd.txt
Template:
Category:
HBGD
Subcategory:
Oneliner:
floods a portion of the image with the specified color.
Syntax:
gdImageFill( , , , ) --> NIL
Arguments:
- Image pointer
- start point horizontal position
- start point vertical position
- Color index of filling color
Returns:
NIL
Description:
gdImageFill() floods a portion of the image with the specified color, beginning at the
specified point and flooding the surrounding region of the same color as the starting point.
For a way of flooding a region defined by a specific border color rather than by its interior
color, see gdImageFillToBorder().
The fill color can be gdTiled, resulting in a tile fill using another image as the tile.
However, the tile image cannot be transparent. If the image you wish to fill with has a
transparent color index, call gdImageTransparent on the tile image and set the transparent
color index to -1 to turn off its transparency.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue, red
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
red := gdImageColorAllocate(pImage, 255, 0, 0)
// Draw an ellipse
gdImageArc(pImage, 50, 25, 98, 48, 0, 360, blue)
// Fill the ellipse
gdImageFill(pImage, 50, 50, red)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
Draws a partial filled ellipse centered at a given point.
Syntax:
gdImageArc( , , , , , , , , ) --> NIL
Arguments:
- Image pointer
- center point horizontal position
- center point vertical position
- width
- height
- start degree
- end degree
- Color index
- fill style
Returns:
NIL
Description:
gdImageFilledArc() is used to draw a partial ellipse centered at the given point,
with the specified width and height in pixels. The arc begins at the position
in degrees specified by s and ends at the position specified by e.
The arc is drawn in the color specified by the last argument. A circle can be drawn
by beginning from 0 degrees and ending at 360 degrees, with width and height being equal.
must be greater than . Values greater than 360 are interpreted modulo 360.
To set the color index you have to use gdImageColorAllocate() function.
Last parameter is a bitwise OR of the following possibilities:
gdArc
gdChord
gdPie (synonym for gdArc)
gdNoFill
gdEdged
gdArc and gdChord are mutually exclusive;
gdChord just connects the starting and ending angles with a straight line,
while gdArc produces a rounded edge. gdPie is a synonym for gdArc.
gdNoFill indicates that the arc or chord should be outlined, not filled.
gdEdged, used together with gdNoFill, indicates that the beginning and ending
angles should be connected to the center; this is a good way to outline
(rather than fill) a 'pie slice'
these constants are defined in gd.ch
Examples:
#include "gd.ch"
PROCEDURE Main()
LOCAL pImage
LOCAL blue
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw an ellipse
gdImageFilledArc(pImage, 50, 25, 98, 48, 0, 360, blue, gdArc)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
- Image pointer
- center point horizontal position
- center point vertical position
- width
- height
- Color index
Returns:
NIL
Description:
gdImageFilledEllipse() is used to draw a filled ellipse centered at the given point,
with the specified width and height in pixels.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw an ellipse
gdImageFilledEllipse(pImage, 50, 25, 98, 48, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
Draws a filled polygon with verticies (at least 3) with a particular color index.
Syntax:
gdImageFilledPolygon( , , ) --> NIL
Arguments:
- Image pointer
- Array of point array { , } where
is horizontal position
is vertical position
- Color index
Returns:
NIL
Description:
gdImageFilledPolygon() Draws a filled polygon with verticies (at least 3) with a
particular color index.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
LOCAL aVerticies := { ;
{ 50, 0 } ,;
{ 99, 99 } ,;
{ 0, 99 } ;
}
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw a filled polygon
gdImageFilledPolygon(pImage, aVerticies, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
Draws a filled rectangle with a particular color index.
Syntax:
gdImageFilledRectangle( , , , , , ) --> NIL
Arguments:
- Image pointer
- upper left point horizontal position
- upper left point vertical position
- lower right point horizontal position
- lower right point vertical position
- Color index
Returns:
NIL
Description:
gdImageFilledRectangle() draws a filled rectangle between 2 points with a
particular color index.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw a filled rectangle
gdImageFilledRectangle(pImage, 10, 10, 50, 50, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
floods a portion of the image with the specified color.
Syntax:
gdImageFillToBorder( , , , , ) --> NIL
Arguments:
- Image pointer
- start point horizontal position
- start point vertical position
- Color index where fill stops
- Color index of filling color
Returns:
NIL
Description:
gdImageFillToBorder() floods a portion of the image with the specified color,
beginning at the specified point and stopping at the specified border color. For a way of
flooding an area defined by the color of the starting point, see gdImageFill().
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue, red
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
red := gdImageColorAllocate(pImage, 255, 0, 0)
// Draw an ellipse
gdImageArc(pImage, 50, 25, 98, 48, 0, 360, blue)
// Fill the ellipse
gdImageFillToBorder(pImage, 50, 50, blue, red)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
gdImageFromGD() creates a GD image from a file or a handle or another image in memory.
You can use one of 3 syntax:
pImage := gdImageFromGD( "myimage.gd" )
or
pImage := gdImageFromGD( nFileHandle, nSize )
or
pImage := gdImageFromGD( pMemoryImagePtr, nSize )
the pImage pointer returned will be not NIL if successfull and will contains a memory pointer
to the GD image.
Remember to free memory with gdImageDestroy() before exit from application.
HBGD uses it's own memory to manage an image, so it is important to use this function.
Examples:
PROCEDURE Main()
LOCAL pImage
pImage := gdImageFromGD( "myimage.gd" )
// Use here image
.........
gdImageDestroy( pImage )
RETURN
gdImageFromGif() creates a GIF image from a file or a handle or another image in memory.
You can use one of 3 syntax:
pImage := gdImageFromGif( "myimage.gif" )
or
pImage := gdImageFromGif( nFileHandle, nSize )
or
pImage := gdImageFromGif( pMemoryImagePtr, nSize )
the pImage pointer returned will be not NIL if successfull and will contains a memory pointer
to the gif image.
Remember to free memory with gdImageDestroy() before exit from application.
HBGD uses it's own memory to manage an image, so it is important to use this function.
Examples:
PROCEDURE Main()
LOCAL pImage
pImage := gdImageFromGif( "myimage.gif" )
// Use here image
.........
gdImageDestroy( pImage )
RETURN
gdImageFromJpeg() creates a JPEG image from a file or a handle or another image in memory.
You can use one of 3 syntax:
pImage := gdImageFromJpeg( "myimage.jpg" )
or
pImage := gdImageFromJpeg( nFileHandle, nSize )
or
pImage := gdImageFromJpeg( pMemoryImagePtr, nSize )
the pImage pointer returned will be not NIL if successfull and will contains a memory pointer
to the jpeg image.
Remember to free memory with gdImageDestroy() before exit from application.
HBGD uses it's own memory to manage an image, so it is important to use this function.
Examples:
PROCEDURE Main()
LOCAL pImage
pImage := gdImageFromJpeg( "myimage.jpg" )
// Use here image
.........
gdImageDestroy( pImage )
RETURN
gdImageFromPng() creates a PNG image from a file or a handle or another image in memory.
You can use one of 3 syntax:
pImage := gdImageFromPng( "myimage.png" )
or
pImage := gdImageFromPng( nFileHandle, nSize )
or
pImage := gdImageFromPng( pMemoryImagePtr, nSize )
the pImage pointer returned will be not NIL if successfull and will contains a memory pointer
to the png image.
Remember to free memory with gdImageDestroy() before exit from application.
HBGD uses it's own memory to manage an image, so it is important to use this function.
Examples:
PROCEDURE Main()
LOCAL pImage
pImage := gdImageFromPng( "myimage.png" )
// Use here image
.........
gdImageDestroy( pImage )
RETURN
gdImageFromWBmp() creates a WBmp image from a file or a handle or another image in memory.
You can use one of 3 syntax:
pImage := gdImageFromWBmp( "myimage.wbmp" )
or
pImage := gdImageFromWBmp( nFileHandle, nSize )
or
pImage := gdImageFromWBmp( pMemoryImagePtr, nSize )
the pImage pointer returned will be not NIL if successfull and will contains a memory pointer
to the WBmp image.
Remember to free memory with gdImageDestroy() before exit from application.
HBGD uses it's own memory to manage an image, so it is important to use this function.
Examples:
PROCEDURE Main()
LOCAL pImage
pImage := gdImageFromWBmp( "myimage.wbmp" )
// Use here image
.........
gdImageDestroy( pImage )
RETURN
gdImageGif() saves a GIF image to a file or a handle.
You can use one of 2 syntax:
gdImageGif( pImage, "myimage.gif" )
or
gdImageGif( pImage, nFileHandle )
- Image pointer
- Image file name
- File handle
- a numeric value between 0=max compression and 95=min compression (best quality)
default is -1=auto
Returns:
NIL
Description:
gdImageJpeg() saves a JPEG image to a file or a handle.
You can use one of 2 syntax:
gdImageJpeg( pImage, "myimage.jpg" )
or
gdImageJpeg( pImage, nFileHandle )
Draws a line between two end points (x1, y1 and x2, y2) with a particular color index.
Syntax:
gdImageLine( , , , , , ) --> NIL
Arguments:
- Image pointer
- 1st point horizontal position
- 1st point vertical position
- 2nd point horizontal position
- 2nd point vertical position
- Color index
Returns:
NIL
Description:
gdImageLine() Draws a line between two end points (x1, y1 and x2, y2)
with a particular color index.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw a line
gdImageLine(pImage, 10, 10, 90, 90, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
Draws an open polygon with verticies (at least 3) with a particular color index.
Syntax:
gdImageOpenPolygon( , , ) --> NIL
Arguments:
- Image pointer
- Array of point array { , } where
is horizontal position
is vertical position
- Color index
Returns:
NIL
Description:
gdImageOpenPolygon() Draws an open polygon with verticies (at least 3) with a
particular color index. Unlike gdImagePolygon() the endpoints of the line sequence
are not connected to close the polygon.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
LOCAL aVerticies := { ;
{ 50, 0 } ,;
{ 99, 99 } ,;
{ 0, 99 } ;
}
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draws an open polygon
gdImageOpenPolygon(pImage, aVerticies, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
- Image pointer
- Image file name
- File handle
- a numeric value between 0=no compression and 9=max compression
default is -1=auto
Returns:
NIL
Description:
gdImagePng() saves a PNG image to a file or a handle.
You can use one of 2 syntax:
gdImagePng( pImage, "myimage.png" )
or
gdImagePng( pImage, nFileHandle )
Draws a closed polygon with verticies (at least 3) with a particular color index.
Syntax:
gdImagePolygon( , , ) --> NIL
Arguments:
- Image pointer
- Array of point array { , } where
is horizontal position
is vertical position
- Color index
Returns:
NIL
Description:
gdImagePolygon() Draws a closed polygon with verticies (at least 3) with a
particular color index.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
LOCAL aVerticies := { ;
{ 50, 0 } ,;
{ 99, 99 } ,;
{ 0, 99 } ;
}
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw a polygon
gdImagePolygon(pImage, aVerticies, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
- Image pointer
- upper left point horizontal position
- upper left point vertical position
- lower right point horizontal position
- lower right point vertical position
- Color index
Returns:
NIL
Description:
gdImageRectangle() draws a rectangle between 2 points with a
particular color index.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL blue
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
blue := gdImageColorAllocate(pImage, 0, 0, 255)
// Draw a rectangle
gdImageRectangle(pImage, 10, 10, 50, 50, blue)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
specify the actual foreground color to be used when drawing antialiased lines.
Syntax:
gdImageSetAntiAliased( , ) --> NIL
Arguments:
- Image pointer
- Color index of filling color
Returns:
NIL
Description:
"Antialiasing" is a process by which jagged edges associated with line drawing
can be reduced by blending the foreground color with an appropriate percentage of
the background, depending on how much of the pixel in question is actually within
the boundaries of the line being drawn. All line-drawing functions, such as gdImageLine(),
gdImageOpenPolygon() and gdImagePolygon(), will draw antialiased lines if the special "color"
gdAntiAliased constant is used when calling them.
gdImageSetAntiAliased is used to specify the actual foreground color to be used when drawing
antialiased lines. You may set any color to be the foreground, however as of version 2.0.12
an alpha channel component is not supported.
Antialiased lines can be drawn on both truecolor and palette-based images. However,
attempts to draw antialiased lines on highly complex palette-based backgrounds may not give
satisfactory results, due to the limited number of colors available in the palette. Antialiased
line-drawing on simple backgrounds should work well with palette-based images; otherwise create
or fetch a truecolor image instead.
You need not take any special action when you are finished with antialised line drawing.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
#include "gd.ch"
PROCEDURE Main()
LOCAL pImage
LOCAL blue, red
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
/* Background color (first allocated) */
blue := gdImageColorAllocate(pImage, 0, 0, 255)
red := gdImageColorAllocate(pImage, 255, 0, 0)
gdImageSetAntiAliased(pImage, blue)
// Draw a smooth line
gdImageLine(pImage, 0, 0, 99, 9, gdAntiAliased)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
A "brush" is an image used to draw wide, shaped strokes in another image.
Syntax:
gdImageSetBrush( , ) --> NIL
Arguments:
- Image pointer
- Brush Image pointer
Returns:
NIL
Description:
A "brush" is an image used to draw wide, shaped strokes in another image.
Just as a paintbrush is not a single point, a brush image need not be a single pixel.
Any gd image can be used as a brush, and by setting the transparent color index of the
brush image with gdImageColorTransparent, a brush of any shape can be created.
All line-drawing functions, such as gdImageLine, gdImageOpenPolygon and gdImagePolygon,
will use the current brush if the special "color" gdBrushed or gdStyledBrushed is used
when calling them.
gdImageSetBrush is used to specify the brush to be used in a particular image.
You can set any image to be the brush. If the brush image does not have the same color
map as the first image, any colors missing from the first image will be allocated.
If not enough colors can be allocated, the closest colors already available will be used.
This allows arbitrary PNGs to be used as brush images. It also means, however, that you
should not set a brush unless you will actually use it; if you set a rapid succession of
different brush images, you can quickly fill your color map, and the results will not be
optimal.
You need not take any special action when you are finished with a brush. As for any other image,
if you will not be using the brush image for any further purpose, you should call gdImageDestroy.
You must not use the color gdBrushed if the current brush has been destroyed; you can of course
set a new brush to replace it.
Examples:
PROCEDURE Main()
LOCAL pImage, pBrush
LOCAL blue, red
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Open the brush PNG. For best results, portions of the brush that should be transparent
// (ie, not part of the brush shape) should have the transparent color index.
pBrush := gdImageCreateFromPng( "mybrush.png" )
// Allocate color (background color is the first allocate)
black := gdImageColorAllocate(pImage, 0, 0, 0)
// Set the brush
gdImageSetBrush(pImage, pBrush)
// Draw a line from the upper left corner to the lower
// right corner using the brush.
gdImageLine(pImage, 0, 0, 99, 99, gdBrushed)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
// Destroy the brush image
gdImageDestroy( pBrush )
RETURN
- Image pointer
- Horizontal position
- Vertical position
- Color index
Returns:
NIL
Description:
gdImageSetPixel() sets a pixel to a particular color index.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL white
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
white := gdImageColorAllocate(pImage, 255, 255, 255)
// Draw a pixel
gdImageSetPixel(pImage, 50, 50, white)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
set any desired series of colors to be repeated during the drawing of a line.
Syntax:
gdImageSetStyle( , ) --> NIL
Arguments:
- Image pointer
- Array of colors and special colors used to "style" a line
Returns:
NIL
Description:
It is often desirable to draw dashed lines, dotted lines, and other variations
on a broken line. gdImageSetStyle can be used to set any desired series of colors,
including a special color that leaves the background intact, to be repeated during
the drawing of a line.
To use gdImageSetStyle, create an array of integers and assign them the desired series
of color values to be repeated. You can assign the special color value gdTransparent
to indicate that the existing color should be left unchanged for that particular pixel
(allowing a dashed line to be attractively drawn over an existing image).
Then, to draw a line using the style, use the normal gdImageLine function with the
special color value gdStyled.
The style array is copied when you set the style, so you need not be concerned with
keeping the array around indefinitely. This should not break existing code that assumes
styles are not copied.
You can also combine styles and brushes to draw the brush image at intervals instead of
in a continuous stroke. When creating a style for use with a brush, the style values are
interpreted differently: zero (0) indicates pixels at which the brush should not be drawn,
while one (1) indicates pixels at which the brush should be drawn. To draw a styled,
brushed line, you must use the special color value gdStyledBrushed.
Examples:
#include "gd.ch"
PROCEDURE Main()
LOCAL pImage, aStyleDotted := {}, aStyleDashed := {}
LOCAL black, red
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color (background color is the first allocate)
black := gdImageColorAllocate(pImage, 0, 0, 0)
red := gdImageColorAllocate(pImage, 255, 0, 0)
// Set up dotted style. Leave every other pixel alone.
aAdd( aStyleDotted, red )
aAdd( aStyleDotted, gdTransparent )
// Set up dashed style. Three on, three off.
aAdd( aStyleDashed, red )
aAdd( aStyleDashed, red )
aAdd( aStyleDashed, red )
aAdd( aStyleDashed, gdTransparent )
aAdd( aStyleDashed, gdTransparent )
aAdd( aStyleDashed, gdTransparent )
// Set dotted style.
gdImageSetStyle(pImage, aStyleDotted)
// Draw a line from the upper left corner to the lower right corner.
gdImageLine(pImage, 0, 0, 99, 99, gdStyled)
// Now the dashed line.
gdImageSetStyle(pImage, aStyleDashed)
gdImageLine(pimage, 0, 99, 0, 99, gdStyled)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
gdImageSetThickness determines the width of lines drawn by the gdImageLine,
gdImagePolygon, gdImageOpenPolygon and related functions, in pixels.
Examples:
#include "gd.ch"
PROCEDURE Main()
LOCAL pImage
LOCAL black, white
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color (background color is the first allocate)
black := gdImageColorAllocate(pImage, 0, 0, 0)
white := gdImageColorAllocate(pImage, 255, 255, 255)
// Set thickness.
gdImageSetThickness(pImage, 4)
// Draw a fat line from the upper left corner to the lower right corner.
gdImageLine(pImage, 0, 0, 99, 99, white)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
A "tile" is an image used to fill an area with a repeated pattern.
Syntax:
gdImageSetTile( , ) --> NIL
Arguments:
- Image pointer
- Tile Image pointer
Returns:
NIL
Description:
A "tile" is an image used to fill an area with a repeated pattern.
Any gd image can be used as a tile, and by setting the transparent color index of
the tile image with gdImageColorTransparent, a tile that allows certain parts of
the underlying area to shine through can be created. All region-filling functions,
such as gdImageFill and gdImageFilledPolygon, will use the current tile if the special
"color" gdTiled is used when calling them.
gdImageSetTile is used to specify the tile to be used in a particular image. You can
set any image to be the tile. If the tile image does not have the same color map as
the first image, any colors missing from the first image will be allocated. If not
enough colors can be allocated, the closest colors already available will be used.
This allows arbitrary PNGs to be used as tile images. It also means, however, that you
should not set a tile unless you will actually use it; if you set a rapid succession of
different tile images, you can quickly fill your color map, and the results will not be optimal.
You need not take any special action when you are finished with a tile. As for any other
image, if you will not be using the tile image for any further purpose, you should call
gdImageDestroy. You must not use the color gdTiled if the current tile has been destroyed;
you can of course set a new tile to replace it.
Examples:
PROCEDURE Main()
LOCAL pImage, pTile
LOCAL blue, red
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Open the tile PNG. For best results, portions of the
// tile that should be transparent (ie, allowing the
// background to shine through) should have the transparent
// color index.
pTile := gdImageCreateFromPng( "mytile.png" )
// Allocate color (background color is the first allocate)
black := gdImageColorAllocate(pImage, 0, 0, 0)
// Set the tile
gdImageSetTile(pImage, pTile)
// Fill an area using the tile
gdImageFilledRectangle(pImage, 25, 25, 75, 75, gdTiled)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
// Destroy the tile image
gdImageDestroy( pTile )
RETURN
- Image pointer
- Image file name
- File handle
- foreground color value to be used as foreground, the others are background
Returns:
NIL
Description:
gdImageWBmp() saves a WBMP image to a file or a handle.
You can use one of 2 syntax:
gdImageWBmp( pImage, "myimage.wbmp", nColor )
or
gdImagePng( pImage, nFileHandle, nColor )
Examples:
PROCEDURE Main()
LOCAL pImage
LOCAL white, black
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate background
white := gdImageColorAllocate(pImage, 255, 255, 255)
// Allocate drawing color
black := gdImageColorAllocate(pImage, 0, 0, 0)
// Draw a rectangle
gdImageRectangle(pImage, 0, 0, 99, 99, black)
// Save the image with black as foreground color
gdImageWBmp( pImage, "myimage.wbmp", black )
// Destroy the image
gdImageDestroy( pImage )
RETURN
indicate the special color that the foreground should stand out more clearly against.
Syntax:
gdSetAntiAliasedDontBlend( , ) --> NIL
Arguments:
- Image pointer
- Color index of filling color
Returns:
NIL
Description:
Normally, when drawing lines with the special gdAntiAliased "color," blending with
the background to reduce jagged edges is the desired behavior. However, when it is
desired that lines not be blended with one particular color when it is encountered
in the background, the gdImageSetAntiAliasedDontBlend() function can be used to indicate
the special color that the foreground should stand out more clearly against.
To set the color index you have to use gdImageColorAllocate() function.
Examples:
#include "gd.ch"
PROCEDURE Main()
LOCAL pImage
LOCAL black, white, blue
// Create an image in memory
pImage := gdImageCreate( 100, 100 )
// Allocate color
/* Background color (first allocated) */
black := gdImageColorAllocate(pImage, 0, 0, 0)
white := gdImageColorAllocate(pImage, 255, 255, 255)
blue := gdImageColorAllocate(pImage, 0, 0, 255)
gdImageSetAntiAliased(pImage, blue)
// The portion of the line that crosses this white rectangle will not be blended smoothly
gdImageSetAntiAliasedDontBlend(pImage, white)
// Draw a smooth line
gdImageLine(pImage, 0, 0, 99, 9, gdAntiAliased)
// Save the image
gdImageJpeg( pImage, "myimage.jpg" )
// Destroy the image
gdImageDestroy( pImage )
RETURN
This function yields a string that is the value of the
environment variable , which is stored at the
system level.
If no environment variable
is found, an empty string is returned.
This is CA-Cl*pper compliant.
The parameter is a Harbour extension.
Files:
src/rtl/gete.c
Library is rtl
See also:
GETENV
GETENV()
Lang:
misc.txt
Component:
harbour
Doc. source:
.\doc\en\misc.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Obtains a system environmental setting.
Syntax:
GETENV( ) -->
Arguments:
Enviromental variable to obtain.
Returns:
Value of the Environment Variable.
Description:
This function yields a string that is the value of the
environment variable , which is stored at the
system level.
If no environment variable
is found, an empty string is returned.
Be aware that calls to this functions do _NOT_ affect the
calculation precision of the math functions at the moment.
Examples:
Status:
Ready
Compliance:
GETPREC() is compatible with CT3's GETPREC.
Files:
Source is ctmath.c, library is ct3.
See also:
GNU License
Lang:
gnulice.txt
Component:
harbour
Doc. source:
.\doc\en\gnulice.txt
Template:
Document
Category:
Document
Subcategory:
License
Oneliner:
Gnu License File Part 1
Syntax:
Arguments:
Returns:
Description:
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit
to using it. (Some other Free Software Foundation software is
covered by the GNU Library General Public License instead.)
You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and
charge for this service if you wish), that you receive source code
or can get it if you want it, that you can change the software or
use pieces of it in new free programs; and that you know you can do
these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the
rights. These restrictions translate to certain responsibilities
for you if you distribute copies of the software, or if you modify
it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights
that you have. You must make sure that they, too, receive or can
get the source code. And you must show them these terms so they
know their rights.
We protect your rights with two steps: (1) copyright the software,
and (2) offer you this license which gives you legal permission to
copy, distribute and/or vmodify the software.
Also, for each author's protection and ours, we want to make
certain that everyone understands that there is no warranty for
this free software. If the software is modified by someone else and
passed on, we want its recipients to know that what they have is
not the original, so that any problems introduced by others will
not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making
the program proprietary. To prevent this, we have made it clear
that any patent must be licensed for everyone's free use or not
licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work
based on the Program" means either the Program or any derivative
work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications
and/or translated into another language. (Hereinafter, translation
is included without limitation in the term "modification".) Each
licensee is addressed as "you". Activities other than copying,
distribution and modification are not covered by this License; they
are outside its scope. The act of running the Program is not
restricted, and the output from the Program is covered only if its
contents constitute a work based on the Program (independent of
having been made by running the Program). Whether that is true
depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any
warranty; and give any other recipients of the Program a copy of
this License along with the Program. You may charge a fee for the
physical act of transferring a copy, and you may at your option
offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that
in whole or in part contains or is derived from the Program or
any part thereof, to be licensed as a whole at no charge to all
third parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you
provide a warranty) and that users may redistribute the program
under these conditions, and telling the user how to view a copy
of this License. (Exception: if the Program itself is interactive
but does not normally print such an announcement, your work based
on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the
Program, and can be reasonably considered independent and separate
works in themselves, then this License, and its terms, do not apply
to those sections when you distribute them as separate works. But
when you distribute the same sections as part of a whole which is a
work based on the Program, the distribution of the whole must be on
the terms of this License, whose permissions for other licensees
extend to the entire whole, and thus to each and every part
regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or
contest your rights to work written entirely by you; rather, the
intent is to exercise the right to control the distribution of
derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the
Program with the Program (or with a work based on the Program) on a
volume of a storage or distribution medium does not bring the other
work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms
of Sections 1 and 2 above provided that you also do one of the
following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software
interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus
any associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as
a special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of
the operating system on which the executable runs, unless that
component itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this
License. However, parties who have received copies, or rights, from
you under this License will not have their licenses terminated so
long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so,
and all its terms and conditions for copying, distributing or
modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject
to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted
herein. You are not responsible for enforcing compliance by third
parties to this License.
Examples:
Status:
Compliance:
Files:
See also:
GNU License..
GNU License..
Lang:
gnulice.txt
Component:
harbour
Doc. source:
.\doc\en\gnulice.txt
Template:
Document
Category:
Document
Subcategory:
License
Oneliner:
Gnu License File Part 2
Syntax:
Arguments:
Returns:
Description:
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent
issues), conditions are imposed on you (whether by court order,
agreement or otherwise) that contradict the conditions of this
License, they do not excuse you from the conditions of this
License. If you cannot distribute so as to satisfy simultaneously
your obligations under this License and any other pertinent
obligations, then as a consequence you may not distribute the
Program at all. For example, if a patent license would not permit
royalty-free redistribution of the Program by all those who receive
copies directly or indirectly through you, then the only way you
could satisfy both it and this License would be to refrain entirely
from distribution of the Program.
If any portion of this section is held invalid or unenforceable
under any particular circumstance, the balance of the section is
intended to apply and the section as a whole is intended to apply
in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of
any such claims; this section has the sole purpose of protecting
the integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is
willing to distribute software through any other system and a
licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed
to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces,
the original copyright holder who places the Program under this
License may add an explicit geographical distribution limitation
excluding those countries, so that distribution is permitted only
in or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this
License.
9. The Free Software Foundation may publish revised and/or new
versions of the General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies a version number of this License which applies to
it and "any later version", you have the option of following the
terms and conditions either of that version or of any later version
published by the Free Software Foundation. If the Program does not
specify a version number of this License, you may choose any
version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the
author to ask for permission. For software which is copyrighted by
the Free Software Foundation, write to the Free Software
Foundation; we sometimes make exceptions for this. Our decision
will be guided by the two goals of preserving the free status of
all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR
OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make
it free software which everyone can redistribute and change under
these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at
least the "copyright" line and a pointer to where the full notice
is found:
Copyright (C) yyyy
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper
mail. If the program is interactive, make it output a short notice
like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'. This is free software, and you are welcome
to redistribute it under certain conditions; type `show c'
for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and
`show c'; they could even be mouse-clicks or menu items--whatever
suits your program.
You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the
program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (which makes passes at compilers) written by
James Hacker.
signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your
program into proprietary programs. If your program is a subroutine
library, you may consider it more useful to permit linking
proprietary applications with the library. If this is what you want
to do, use the GNU Library General Public License instead of this
License.
FSF & GNU inquiries & questions to gnu@gnu.org.
Copyright notice above.
Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111, USA
Updated: 3 Jan 2000 rms
Examples:
Status:
Compliance:
Files:
See also:
License,GNU License
GT_ASCIISUM()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Sum the ascii values in a string.
Syntax:
GT_AsciiSum() --> nSum
Arguments:
- The string to sum
Returns:
- The sum of all ascii values in .
Description:
Sum the ascii value of every character in the passed string
and return the result.
Examples:
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_ASCPOS()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Return the ascii value of a specified character in a string
Syntax:
GT_Ascpos(, ) --> nAscVal
Arguments:
- The string
- The position in
Returns:
- The ascii value of substr(, , 1)
Description:
Return the ascii value of a specified character in a string
Equivalent (but much faster) to
asc(substr(cStr, nPos, 1)
NOTE:
invalid parameters will return -1
nPos > len(cStr) will return -2
This last behaviour is different to the Funcky function of the
same name. I changed the behaviour because some of the strings
I process contain embedded NULs.
Examples:
? gt_ascpos("the cat sat on the mat", 3) // prints e
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_ATDIFF()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Return the position where two strings begin to differ
Syntax:
GT_AtDiff(, ) --> nPos
Arguments:
- A character string to compare
- The string to compare with
Returns:
- The position in where begins to differ
Description:
Return the position in where begins to differ.
If the strings differ in the first character GT_AtDiff() will
return 1. If the two strings are identical (or identical upto
the last character in ) the function will return 0.
NOTE:
invalid parameters will return -1
Examples:
? gt_atDiff("the cat", "the rat") // prints 5
? gt_atDiff("the cat", "the ") // prints 0
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_CHAREVEN()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Return a string of all the characters in even positions
Syntax:
GT_CharEven() --> cRet
Arguments:
- A character string to extract chars from
Returns:
- A string of all the chars in even positions
Description:
Return a string consisting of all the characters in even
positions in .
NOTE:
invalid parameters will return ""
Examples:
? gt_CharEven("abcdefghijklm") // prints "bdfhjl"
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_CHARMIX()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Amalgamate two strings to form the return value
Syntax:
GT_CharMix(, ) --> cRet
Arguments:
- A character string to mix
- A character string to mix with
Returns:
- A string consisting of all the characters in
mixed with all the characters in
Description:
Return a string consisting of all the characters in
mixed with the characters from .
NOTE:
invalid parameters will return ""
Examples:
? gt_CharMix("abc", "123") // prints "a1b2c3"
? gt_CharMix("abcde", "123") // prints "a1b2c3de"
? gt_CharMix("abc", "12345") // prints "a1b2c345"
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_CHARODD()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Return a string of all the characters in odd positions
Syntax:
GT_CharOdd() --> cRet
Arguments:
- A character string to extract chars from
Returns:
- A string of all the chars in odd positions
Description:
Return a string consisting of all the characters in odd
positions in .
NOTE:
invalid parameters will return ""
Examples:
? gt_CharOdd("abcdefghijklm") // prints "acegikm"
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_CHRCOUNT()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Count the number of times a character appears in a string
Syntax:
GT_ChrCount(, ) --> nFreq
Arguments:
- The character to find the frequence of
- The string in which to find the character
Returns:
nFreq - The number of times occurs in
Description:
GT_ChrCount() counts how many times a specified character
appears in a string.
NOTE:
invalid parameters will return -1
Examples:
? GT_ChrCount("t", "the cat sat on the mat") // prints 4
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_CHRFIRST()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Find which character occurs first in a string
Syntax:
GT_ChrFirst(, ) --> nAsc
Arguments:
- The set of characters to find
- The input string
Returns:
- The ASCII value of the first character in
which appears first in
Description:
Return the ascii value of a character in
which appears first in .
Examples:
? chr(GT_ChrFirst("sa ", "This is a test")) // prints "s"
? chr(GT_ChrFirst("et", "This is a test")) // prints "t"
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_CHRTOTAL()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Find number of times a set of characters appears in a string
Syntax:
GT_ChrTotal(, ) --> nTotOcc
Arguments:
- The set of characters
- The string to search
Returns:
- The number of times the characters specified in
appears in
Description:
Returns the numnber of occurrences of characters belonging
to the set in the string . If no characters
in appears in GT_ChrTotal() will return 0.
NOTE:
invalid parameters will return -1
Examples:
local cStr1 := "the cat sat on the mat"
? GT_ChrTotal("tae", cStr1) // prints 10
? GT_ChrTotal("zqw", cStr1) // prints 0
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_CLRFLAG()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
General
Subcategory:
Oneliner:
Set a number of flags to FALSE in a bit flag string.
Syntax:
GT_ClrFlag(,[],[]) --> cFlagString
Arguments:
is a bit flag string created with GT_NewFlag()
is the starting flag. This is an optional numeric value.
If not supplied it defaults to 1.
is the ending flag. This is an optional numeric value. If
not supplied it defaults to .
Returns:
The bit map string with the new flag settings.
Description:
GT_ClrFlag() is used to turn flags within the flag string off.
Examples:
cFlags := GT_NewFlag(20) // Create a bit flag string for 20
// logical values.
// Now, turn them all on.
cFlags := GT_SetFlag(cFlags,1,20)
// Now set flags 10 to 15 to false.
cFlags := GT_ClrFlag(cFlags,10,15)
// And set flag 18 to false.
cFlags := GT_ClrFlag(cFlags,18)
// And set flag 1 to false.
cFlags := GT_ClrFlag(cFlags)
Status:
Compliance:
Files:
See also:
GT_NEWFLAG() GT_SETFLAG() GT_ISFLAG()
GT_ISFLAG()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
General
Subcategory:
Oneliner:
Test the setting of a flag in a bit flag string.
Syntax:
GT_IsFlag(,[]) --> lSetting
Arguments:
is a bit flag string created with GT_NewFlag()
is the flag to be tested.
Returns:
A boolean value, TRUE if the flag is on, FALSE if it's off.
Description:
GT_IsFlag() is used to test the state of a flag with a bit flag
string.
Examples:
// Print the setting of the flags in a flag string called ``cDave''
for nFlag := 1 to (len(cDave)*8)
? "Flag number ",nFlag," == ",GT_IsFlag(cDave,nFlag)
next
Status:
Compliance:
Files:
See also:
GT_NEWFLAG() GT_SETFLAG() GT_CLRFLAG()
GT_NEWFLAG()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
General
Subcategory:
Oneliner:
Create a new bit flag string.
Syntax:
GT_NewFlag() --> cFlagString
Arguments:
is the number of flags you wish to store.
Returns:
A string to hold the bit flags. All flags are set to FALSE.
Description:
GT_NewFlag() is used to construct a bit flag string. The bit flag
functions can be used for storing a large number of logical values
in a small space.
To create a bit flag string you need to pass GT_NewFlag() a value
that is equal to or greater than the number of flags required (you
may want to allow for future expansion). Each character in the
string returned from GT_NewFlag() will hold 8 logical values.
Examples:
cFlags := GT_NewFlag(20) // Create a bit flag string for 20
// logical values.
Status:
Compliance:
Files:
See also:
GT_SETFLAG() GT_CLRFLAG() GT_ISFLAG()
GT_SETFLAG()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
General
Subcategory:
Oneliner:
Set a number of flags to TRUE in a bit flag string.
Syntax:
GT_SetFlag(,[],[]) --> cFlagString
Arguments:
is a bit flag string created with GT_NewFlag()
is the starting flag. This is an optional numeric value.
If not supplied it defaults to 1.
is the ending flag. This is an optional numeric value. If
not supplied it defaults to .
Returns:
The bit map string with the new flag settings.
Description:
GT_SetFlag() is used to turn flags within the flag string on.
Examples:
cFlags := GT_NewFlag(20) // Create a bit flag string for 20
// logical values.
// Now set flags 10 to 15 to true.
cFlags := GT_SetFlag(cFlags,10,15)
// And set flag 18 to true.
cFlags := GT_SetFlag(cFlags,18)
// And set flag 1 to true.
cFlags := GT_SetFlag(cFlags)
Status:
Compliance:
Files:
See also:
GT_NEWFLAG() GT_CLRFLAG() GT_ISFLAG()
GT_STRCOUNT()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Count the number of times a substring appears in a string
Syntax:
GT_StrCount(, ) --> nFreq
Arguments:
- The substring to find the frequence of
- The string in which to find the character
Returns:
- The number of times occurs in
Description:
GT_StrCount() counts how many times a specified substring
appears in a string.
If the substring does NOT appear in this function
will return 0.
If the substring is a single character use GT_ChrCount() as
it will be faster.
NOTE:
invalid parameters will return -1
Examples:
? GT_StrCount("the", "the cat sat on the mat") // prints 2
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_STRCSPN()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Return length of prefix in string of chars NOT in set.
Syntax:
GT_strcspn(, ) --> nLength
Arguments:
- The string to find the prefix in
- The set of characters
Returns:
- The length of a string upto a character in the set
Description:
Return the number of characters in the leading segment of a
string that consists solely of characters NOT in the set.
Examples:
? GT_strcspn("this is a test", "as ") // prints 3
? GT_strcspn("this is a test", "elnjpq") // prints 11
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_STRDIFF()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Return a string where it begins to differ from another
Syntax:
GT_StrDiff(, ) --> cRet
Arguments:
- A character string to compare
- The string to compare with
Returns:
- A string beginning at the position in where
begins to differ from
Description:
Return a string beginning at the position in where
begins to differ from . If the two strings are
identical (or identical upto the last character in )
the function will return "".
NOTE:
invalid parameters will return ""
Examples:
? gt_strDiff("the cat", "the rat") // prints "rat"
? gt_strDiff("the cat", "the ") // prints ""
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_STREXPAND()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Insert fillers between characters in a passed string
Syntax:
GT_StrExpand(, [], []) --> cRet
Arguments:
- A character string to insert chars into
- The number of fill characters to insert (default 1)
- The fill chararacter (default space)
Returns:
- The input string with fill characters inserted between
every character in the original.
Description:
Inserts fill characters into a string.
NOTE:
invalid parameters will return ""
Examples:
? gt_strexpand("abc") // prints "a b c"
? gt_strexpand("abc", 2) // prints "a b c"
? gt_strexpand("abc", 2, 'þ') // prints "aþþbþþc"
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_STRLEFT()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Find length of prefix of a string
Syntax:
GT_StrLeft(, ) --> nLen
Arguments:
- The input string
- The set of characters to find
Returns:
nLen - The length of the prefix found.
Description:
Return the length of the leading segment in the passed string
that consists solely of the characters in the character
set .
If no characters in the the search set are found, the function
shall return 0
Examples:
? GT_StrLeft("this is a test", "hsit ") // prints 8
? GT_StrLeft("this is a test", "hit a") // prints 3
? GT_StrLeft("this is a test", "zxy") // prints 0
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_STRPBRK()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Return string after 1st char from a set
Syntax:
GT_StrpBrk(, ) --> cString
Arguments:
- The input string
- The set of characters to find
Returns:
- The input string after the first occurance of any
character from
Description:
Return a string after the first occurance of any character from
the input set .
Examples:
? GT_Strpbrk("This is a test", "sa ") // prints "s is a test"
? GT_Strpbrk("This is a test", "et") // prints "test"
Status:
R
Compliance:
Files:
Library is libgt
See also:
GT_STRRIGHT()
Lang:
hbgt.txt
Component:
hbgt
Doc. source:
hbgt\doc\en\hbgt.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Find length of a suffix of a string
Syntax:
GT_StrRight(, ) --> nLen
Arguments:
- The input string
- The set of characters to find
Returns:
- The length of the prefix found.
Description:
Return the length of the trailing segment in the passed string
that consists solely of the characters in the character
set .
If no characters in the the search set are found, the function
shall return 0
Examples:
? GT_StrRight("this is a test", "teas ") // prints 8
? GT_StrRight("this is a test", "tes h") // prints 5
? GT_StrRight("this is a test", "zxy") // prints 0
Status:
R
Compliance:
Files:
Library is libgt
See also:
Harbour Extensions
Lang:
harbext.txt
Component:
harbour
Doc. source:
.\doc\en\harbext.txt
Template:
Document
Category:
Document
Subcategory:
Oneliner:
Harbour Extensions
Syntax:
Arguments:
Returns:
Description:
Language extensions:
--------------------
* Class generation and management.
CA-Cl*pper only allowed creation of objects from a few standard
classes.
In Harbour, you can create your own classes--complete with
Methods, Instance Variables, Class Variables and Inheritance.
Entire applications can be designed and coded in Object Oriented
style.
* @()
Returns the pointer (address) to a function.
The returned value is not useful to application-level programming, but
is used at a low level to implement object oriented coding.
(Internally, a class method is a static function and there is no
symbol for it, so it is accessed via its address).
* Class HBGetList
Object oriented support for GetLists management.
* ProcName() support for class Method names.
Class Methods can be retrieved from the call stack.
* Memory() has new return values.
See hbmemory.ch
* Transform() --> new function in format string
@0 Make a zero padded string out of the number.
* SToD() --> dDate
New function that converts a yyyymmdd string to a Date value.
* Optional Compile Time STRONG TYPE declaration (and compile time TYPE
MISMATCH warnings)
Example: LOCAL/STATIC Var AS ...
* The Harbour debugger provides new interesting classes:
- Class TDbWindow could be the foundation for a generic multiplatform
- Class TForm
- Class TDbMenu implement both pulldown and popup menus.
RTL enhanced functionality:
---------------------------
- Directory( , , )
The 3rd parameter is a Harbour (optional) parameter and indicates that on
those platforms that support long filenames, that you wish to receive what
would be considered the dos equivalant 8.3 name.
Could affect Adir() and Dir if they were modified to take advantage
of it - currently, they will return long names if the os supports it.
- HB_DiskSpace( , )
The second parameter is a Harbour (optional) parameter and indicates the
type of diskinfo being requested. See en/diskspac.txt for info.
Examples:
Status:
Compliance:
Files:
See also:
Harbour License
Lang:
license.txt
Component:
harbour
Doc. source:
.\doc\en\license.txt
Template:
Document
Category:
Document
Subcategory:
License
Oneliner:
Harbour License
Syntax:
Arguments:
Returns:
Description:
THE HARBOUR PROJECT COMPILER LICENSE
====================================
Note: This license applies to most of the files in the src/compiler
directory.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
their web site at http://www.gnu.org/).
THE HARBOUR PROJECT LIBRARY LICENSE
===================================
Note: This license applies to most of the files in the include directory,
source directory, and subdirectories.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this software; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
As a special exception, the Harbour Project gives permission for
additional uses of the text contained in its release of Harbour.
The exception is that, if you link the Harbour libraries with other
files to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public License.
Your use of that executable is in no way restricted on account of
linking the Harbour library code into it.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License.
This exception applies only to the code released by the Harbour
Project under the name Harbour. If you copy code from other
Harbour Project or Free Software Foundation releases into a copy of
Harbour, as the General Public License permits, the exception does
not apply to the code that you add in this way. To avoid misleading
anyone as to the status of such modified files, you must delete
this exception notice from them.
If you write modifications of your own for Harbour, it is your choice
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.
THE OLD HARBOUR PROJECT LIBRARY LICENSE
=======================================
Note: This license only applies to the following files:
contrib\libmisc\dates2.c (Only the DateTime() function by Jon Berg)
samples\pe\*
source\rtl\philes.c
source\rtl\binnum.c
source\lang\msgsr852.c
source\lang\msgpl852.c
source\lang\msgpliso.c
source\lang\msgplmaz.c
source\lang\msgeu.c
source\lang\msgcsiso.c
source\lang\msgcswin.c
source\lang\msgcskam.c
source\lang\msgsriso.c
source\lang\msgde.c
source\lang\msghr852.c
source\lang\msgcs852.c
source\lang\msghriso.c
source\lang\msgis850.c
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version, with one exception:
The exception is that if you link the Harbour Runtime Library (HRL)
and/or the Harbour Virtual Machine (HVM) with other files to produce
an executable, this does not by itself cause the resulting executable
to be covered by the GNU General Public License. Your use of that
executable is in no way restricted on account of linking the HRL
and/or HVM code into it.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
their web site at http://www.gnu.org/).
THE HARBOUR PROJECT CONTRIB LICENSE
===================================
There is no one single license that applies to the Harbour Project
contrib files. Some files use the Harbour Project Compiler license.
Some files use the Harbour Project Library license. Some files use
the old Harbour Project Library license (and in one case, just one
function in a file that otherwise uses the Harbour Project Library
license uses the old license - this is the DateTime() function in
the file contrib\libmisc\dates2.c). Some files may even use other
types of free software or open source software licenses. Some files
have been donated to the public domain. If you use any of the contrib
files, you need to investigate the license that applies to each file.
Examples:
Status:
Compliance:
Files:
See also:
Overview
HARDCR()
Lang:
memo.txt
Component:
harbour
Doc. source:
.\doc\en\memo.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Replace all soft carriage returns with hard carriages returns.
Syntax:
HARDCR( ) -->
Arguments:
is a string of chars to convert.
Returns:
Trasformed string.
Description:
Returns a string/memo with soft carriage return chars converted to
hard carriage return chars.
Examples:
? HARDCR( Data->CNOTES )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
MEMOTRAN(),STRTRAN()
HBClass()
Lang:
tclass.txt
Component:
harbour
Doc. source:
.\doc\en\tclass.txt
Template:
Function
Category:
API
Subcategory:
Classes
Oneliner:
HBClass() is used in the creation of all classes
Syntax:
oClass := HBClass():New("TMyClass")
-or-
HBClass() is usually accessed by defining a class with the commands
defined in hbclass.h:
CLASS HBGetList // Calls HBClass() to create the HBGetList class
...
ENDCLASS
Arguments:
Returns:
An instance of the HBClass Class. This special object's :New()
method can then create the classes you define.
Description:
HBClass is a class that ...
The class methods are as follows:
New() Create a new instance of the class
Examples:
FUNCTION TestObject()
LOCAL oObject
oObject := HBClass():New("TMyClass")
oObject:End()
RETURN NIL
Status:
R
Compliance:
Object Oriented syntax in Harbour is compatible with CA-Cl*pper.
However CA-Cl*pper only allowed creation of objects from a few standard
classes, and did not let the programmer create new classes.
In Harbour, you can create your own classes--complete with
Methods, Instance Variables, Class Variables and Inheritance.
Entire applications can be designed and coded in Object Oriented
style.
Files:
Library is rtl
See also:
__objHasData(),Object Oriented Programming,CLASS
HBQAbstractItemModel()
Lang:
class_hbqabstractitemmodel.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_hbqabstractitemmodel.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new HBQAbstractItemModel object.
Syntax:
HBQAbstractItemModel( ... )
Arguments:
Returns:
An instance of the object of type HBQAbstractItemModel
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
HBQGraphicsItem()
Lang:
class_hbqgraphicsitem.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_hbqgraphicsitem.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new HBQGraphicsItem object.
Syntax:
HBQGraphicsItem( ... )
Arguments:
Returns:
An instance of the object of type HBQGraphicsItem
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
HBQGraphicsScene()
Lang:
class_hbqgraphicsscene.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_hbqgraphicsscene.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new HBQGraphicsScene object.
Syntax:
HBQGraphicsScene( ... )
Arguments:
Returns:
An instance of the object of type HBQGraphicsScene
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
HBQPlainTextEdit()
Lang:
class_hbqplaintextedit.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_hbqplaintextedit.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new HBQPlainTextEdit object.
Syntax:
HBQPlainTextEdit( ... )
Arguments:
Returns:
An instance of the object of type HBQPlainTextEdit
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
HBQString()
Lang:
class_hbqstring.txt
Component:
qtcore
Doc. source:
hbqt\qtcore\doc\en\class_hbqstring.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new HBQString object.
Syntax:
HBQString( ... )
Arguments:
Returns:
An instance of the object of type HBQString
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtcore
See also:
HBQSyntaxHighlighter()
Lang:
class_hbqsyntaxhighlighter.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_hbqsyntaxhighlighter.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new HBQSyntaxHighlighter object.
Syntax:
HBQSyntaxHighlighter( ... )
Arguments:
Returns:
An instance of the object of type HBQSyntaxHighlighter
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
HBQTableView()
Lang:
class_hbqtableview.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_hbqtableview.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new HBQTableView object.
Syntax:
HBQTableView( ... )
Arguments:
Returns:
An instance of the object of type HBQTableView
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
HBQTextBlockUserData()
Lang:
class_hbqtextblockuserdata.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_hbqtextblockuserdata.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new HBQTextBlockUserData object.
Syntax:
HBQTextBlockUserData( ... )
Arguments:
Returns:
An instance of the object of type HBQTextBlockUserData
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
HB_ANSITOOEM()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Convert a windows Character to a Dos based character
Syntax:
HB_ANSITOOEM( ) --> cDosString
Arguments:
Windows ansi string to convert to DOS oem String
Returns:
Dos based string
Description:
This function converts each character in to the
corresponding character in the MS-DOS (OEM) character set. The
character expression should contain characters from the
ANSI character set. If a character in doesn't have a
MS-DOS equivalent, the character is converted to a similar MS-DOS
character.
is a color list
is the position of the color item to be extracted, the
first position is the zero.
Returns:
The selected color string, or if anything goes wrong, an empty
string.
Description:
CA-Cl*pper has a color spec string, which has more than one
color in it, separated with commas.
This function will extract
a given item from this list. You may use the manifest constants
defined in color.ch to identify and extract common colors.
C Prototype
#include "hbdate.h"
hb_dateStrGet( const char * szDate, long * plYear, long * plMonth, long * plDay )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is rtl
See also:
hb_dateStrPut()
Lang:
hb_date.txt
Component:
harbour
Doc. source:
.\doc\en\hb_date.txt
Template:
Procedure
Category:
C level API
Subcategory:
Date/Time
Oneliner:
Syntax:
C Prototype
#include "hbdate.h"
hb_dateStrPut( char * szDate, long lYear, long lMonth, long lDay )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is rtl
See also:
hb_dateTimeStr()
Lang:
hb_date.txt
Component:
harbour
Doc. source:
.\doc\en\hb_date.txt
Template:
Procedure
Category:
C level API
Subcategory:
Date/Time
Oneliner:
Get the current workstation time
Syntax:
C Prototype
#include "hbdate.h"
hb_dateTimeStr( char * pszTime )
Arguments:
Returns:
Description:
The current workstation time is stored into the buffer pointed
to by pszTime. This buffer must be at least nine characters long.
Examples:
Status:
R
Compliance:
NA
Files:
Library is rtl
See also:
hb_dateToday()
Lang:
hb_date.txt
Component:
harbour
Doc. source:
.\doc\en\hb_date.txt
Template:
Procedure
Category:
C level API
Subcategory:
Date/Time
Oneliner:
Syntax:
C Prototype
#include "hbdate.h"
hb_dateToday( long * plYear, long * plMonth, long * plDay )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is rtl
See also:
HB_DISKSPACE()
Lang:
diskspac.txt
Component:
harbour
Doc. source:
.\doc\en\diskspac.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Get the amount of space available on a disk
Syntax:
HB_DISKSPACE( [] [, ] ) --> nDiskbytes
Arguments:
The drive letter you are requesting info on. The default
is A:
The type of space being requested. The default is HB_DISK_AVAIL.
Returns:
The number of bytes on the requested disk that match the
requested type.
Description:
By default, this function will return the number of bytes of
free space on the current drive that is available to the user
requesting the information.
There are 4 types of information available:
HB_FS_AVAIL The amount of space available to the user making the
request. This value could be less than HB_FS_FREE if
disk quotas are supported by the O/S in use at runtime,
and disk quotas are in effect. Otherwise, the value
will be equal to that returned for HB_FS_FREE.
HB_FS_FREE The actual amount of free diskspace on the drive.
HB_FS_USED The number of bytes in use on the disk.
HB_FS_TOTAL The total amount of space allocated for the user if
disk quotas are in effect, otherwise, the actual size
of the drive.
If information is requested on a disk that is not available, a runtime
error 2018 will be raised.
Examples:
#include "fileio.ch"
? "You can use : " + hb_ntos( hb_DiskSpace() ) + " bytes " +;
"Out of a total of " + hb_ntos( hb_DiskSpace( "C:", HB_FS_TOTAL ) )
Note: See tests\tstdspac.prg for another example
C Prototype
#include "hbapi.h"
hb_dynsymRelease( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_eol()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Returns the newline character(s) to use with the current OS
Syntax:
hb_eol() --> cString
Arguments:
Returns:
A character string containing the character or characters
required to move the screen cursor or print head to the start of a
new line.
Description:
Returns a character string containing the character or characters
required to move the screen cursor or print head to the start of a
new line for the operating system that the program is running on
(or thinks it is running on, if an OS emulator is being used).
Under HB_OS_UNIX operating system the return value is the
Line-Feed character (0x0a, CHR(10)); with other operating systems
(like DOS) the return value is the Carriage-Return plus Line-Feed
characters (0x0d 0x0a, CHR(13)+CHR(10)).
Examples:
// Get the newline character(s) for the current OS.
// Get the newline character(s) for the current OS.
STATIC s_cNewLine
...
s_cNewLine := hb_eol()
...
OutStd( "Hello World!" + s_cNewLine )
Status:
R
Compliance:
H
Files:
Library is rtl
See also:
OS(),OUTSTD(),OUTERR()
hb_errExit()
Lang:
hb_apier.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apier.txt
Template:
Procedure
Category:
C level API
Subcategory:
Error
Oneliner:
Syntax:
C Prototype
#include "hbapierr.h"
hb_errExit( void )
.T. if the file handle is at end-of-file, otherwise .F.
Description:
This function checks an open file handle to see if it is at EOF.
If the file handle is missing, not numeric, or not open, then this
function returns .T. and sets the value returned by FERROR() to -1
(FS_ERROR) or a C-compiler dependent errno value (EBADF or EINVAL).
Requested size of memory block
Pointer to HB_GARBAGE_FUNC function that will be called
directly before releasing the garbage memory block or NULL. This
function should release all other memory allocated and stored inside
the memory block. For example, it releases all items stored inside
the array. The functions receives a single parameter: the pointer
to memory allocated by hb_gcAlloc().
Returns:
The pointer to allocated memory or it generates an internal
unrecoverable error.
Description:
hb_gcAlloc() is used to allocate the memory that will be tracked
by the garbage collector. It allows to properly release memory
in case of self-referencing or cross-referencing harbour level
variables.
Memory allocated with this function should be released with
hb_gcFree() function or it will be automatically deallocated
by the GC if it is not locked or if it is not referenced by some
harbour level variable.
Examples:
See src/vm/arrays.c
Status:
C
Compliance:
H
Files:
src/vm/garbage.c
See also:
hb_gcFree()
hb_gcAlloc()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Allocates a memory controlled by the garbage collector
C Prototype
#include "hbapi.h"
hb_gcCollect( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_gcCollectAll()
Lang:
garbage.txt
Component:
harbour
Doc. source:
.\doc\en\garbage.txt
Template:
Function
Category:
API
Subcategory:
Garbage Collector
Oneliner:
Scans all memory blocks and releases the garbage memory.
Syntax:
void hb_gcCollectAll( void );
Arguments:
None.
Returns:
Nothing.
Description:
This function scans the eval stack, the memvars table, the array
of static variables and table of created classes for referenced
memory blocks. After scanning all unused memory blocks and blocks
that are not locked are released.
Examples:
Status:
C
Compliance:
H
Files:
src/vm/garbage.c
See also:
hb_gcAlloc(),hb_gcFree()
hb_gcCollectAll()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Checks if all memory blocks can be released
Syntax:
C Prototype
#include "hbapi.h"
hb_gcCollectAll( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_gcFree()
Lang:
garbage.txt
Component:
harbour
Doc. source:
.\doc\en\garbage.txt
Template:
Function
Category:
API
Subcategory:
Garbage Collector
Oneliner:
Releases the memory that was allocated with hb_gcAlloc().
Syntax:
void hb_gcFree( void *pMemoryPtr );
Arguments:
The pointer to memory for release. This memory
pointer have to be allocated with hb_gcAlloc() function.
Returns:
Nothing.
Description:
hb_gcFree() is used to deallocate the memory that was
allocated with the hb_gcAlloc() function.
Examples:
See src/vm/arrays.c
Status:
C
Compliance:
H
Files:
src/vm/garbage.c
See also:
hb_gcAlloc()
hb_gcFree()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Deallocates a memory allocated by the garbage collector
Syntax:
C Prototype
#include "hbapi.h"
hb_gcFree( void *pAlloc )
Arguments:
<*pAlloc>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_gcItemRef()
Lang:
garbage.txt
Component:
harbour
Doc. source:
.\doc\en\garbage.txt
Template:
Function
Category:
API
Subcategory:
Garbage Collector
Oneliner:
Marks the memory to prevent deallocation by the garbage collector.
Syntax:
void hb_gcItemRef( PHB_ITEM pItem );
Arguments:
The pointer to item structure that will be scanned. The
passed item can be of any datatype although arrays, objects
and codeblocks are scanned only. Other datatypes don't require
locking so they are simply ignored.
Returns:
Nothing.
Description:
The garbage collector uses hb_gcItemRef() function during
scanning of referenced memory pointers. This function checks the
type of passed item and scans recursively all other memory blocks
referenced by this item if it is an array, an object or a codeblock.
NOTE: This function is reserved for the garbage collector only. It
cannot be called from the user code - calling it can cause
unpredicted results (memory blocks referenced by the
passed item can be released prematurely during the closest
garbage collection).
Examples:
Status:
C
Compliance:
H
Files:
src/vm/garbage.c
See also:
hb_gcAlloc(),hb_gcFree()
hb_gcItemRef()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Checks if passed item refers passed memory block pointer
Syntax:
C Prototype
#include "hbapi.h"
hb_gcItemRef( PHB_ITEM pItem )
C Prototype
#include "hbapi.h"
hb_gcUnlockItem( PHB_ITEM pItem )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
HB_GETENV()
Lang:
misc.txt
Component:
harbour
Doc. source:
.\doc\en\misc.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Obtains a system environmental setting.
Syntax:
HB_GETENV(, [], [] ) -->
Arguments:
Enviromental variable to obtain.
Optional value to return if is not found.
optional logical parameter specifing whether to
apply automatic codepage conversion (to the codepage
specified by Set( _SET_OSCODEPAGE ) on the obtained value.
The default is .T. Note that if the default value is passed and the environment
value is not found, this codepage conversion is not performed against
the returned default value
Returns:
Value of the environment variable or or an empty string.
Description:
This function yields a string that is the value of the
environment variable , which is stored at the
system level.
If no environment variable
can be found, the value of the function will be
if it is passed, else an empty string.
a hash table, created by HB_HASH()
number of items to preallocate in the hash table
Returns:
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HASH()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Returns a hash table
Syntax:
HB_HASH( [ , ], [ , ], ... ) -> hsTable
Arguments:
entry key;
can be of type: number, date, datetime, string, pointer
entry value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table
Returns:
A hash table built from the initial key/value pairs
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HAUTOADD()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Sets the 'auto add' flag for the hash table
Syntax:
HB_HAUTOADD( , [] ) ->
Arguments:
a hash table, created by HB_HASH()
a logical value indicating to turn on or off
the 'auto add' flag of the hash table
Returns:
The previous value of the 'auto add' flag
Description:
This function is equivalent to HB_HAUTOADD() but it returns
the old flag value rather than the hash table
Examples:
LOCAL hsTable, lFlag
hsTable := { "one" => 1, "two" => 2 }
// turn 'auto add' on for a new hash table, storing ol flag
lFlag := hb_HAutoAdd( hsTable, .T. )
Status:
R
Compliance:
H
Files:
See also:
HB_HSETAUTOADD()
HB_HBINARY()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Sets the 'binary' flag for the hash table
Syntax:
HB_HBINARY( , [] ) ->
Arguments:
a hash table, created by HB_HASH()
a logical value indicating to turn on or off
the 'binary' flag of the hash table
Returns:
The previous value of the 'binary' flag
Description:
This function is equivalent to HB_HBINARY() but it returns
the old flag value rather than the hash table
Examples:
LOCAL hsTable, lFlag
hsTable := { "one" => 1, "two" => 2 }
// turn 'binary' on for a new hash table, storing ol flag
lFlag := hb_HBinary( hsTable, .T. )
Status:
R
Compliance:
H
Files:
See also:
HB_HSETBINARY()
HB_HCASEMATCH()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Sets the 'case match' flag for the hash table
Syntax:
HB_HCASEMATCH( , [] ) ->
Arguments:
a hash table, created by HB_HASH()
a logical value indicating to turn on or off
the 'case match' flag of the hash table
Returns:
The previous value of the 'case match' flag
Description:
This function is equivalent to HB_HSETCASEMATCH() but it returns
the old flag value rather than the hash table
Examples:
LOCAL hsTable, lFlag
hsTable := { "one" => 1, "two" => 2 }
// turn 'case match' on for a new hash table, storing ol flag
lFlag := hb_HCaseMatch( hsTable, .T. )
Status:
R
Compliance:
H
Files:
See also:
HB_HSETCASEMATCH()
HB_HCLONE()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Creates a copy of a hash table
Syntax:
HB_HCLONE( ) ->
Arguments:
a hash table, created by HB_HASH()
Returns:
A cloned copy of the hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HCOPY()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Adds entries from the source hash table to the destination hash table
Syntax:
HB_HCOPY( , , [], [] ) ->
Arguments:
a destination hash table, created by HB_HASH()
a source hash table, created by HB_HASH()
starting index, defaults to 1 if omitted
counter, defaults to (length) - is omitted
Returns:
The destination hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HDEFAULT()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Returns/sets a default value for a hash table.
Syntax:
HB_HDEFAULT( , ) ->
Arguments:
a hash table, created by HB_HASH()
Returns:
The previous default value assigned to the hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
TODO: locate and list those methods that use this feature
HB_HDEL()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Removes a key/value pair from a hash table
Syntax:
HB_HDEL( , ) ->
Arguments:
a hash table, created by HB_HASH()
key to be removed from the hash table;
can be of type: number, date, datetime, string, pointer
Returns:
The hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HDELAT()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Removes an entry from a hash table based on its index position
Syntax:
HB_HDELAT( , ) ->
Arguments:
a hash table, created by HB_HASH()
the position of an entry within the hash table that will
be deleted
Returns:
The hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HEVAL()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Evaluate a code block across the contents of a hash table
Syntax:
HB_HEVAL( , , [], [] ) ->
Arguments:
a hash table, created by HB_HASH()
code block to be evaluated
starting index, defaults to 1 if omitted
counter, defaults to (length) - is omitted
Returns:
The hash table
Description:
The code block is evaluated for every hash table entry starting at
for items.
The code block is passed the entry key, value, and numeric position
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HFILL()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Fills a hash table with a value
Syntax:
HB_HFILL( , ) ->
Arguments:
a hash table, created by HB_HASH()
fill value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table
Returns:
The hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HGET()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Returns a hash value
Syntax:
HB_HGET( , ) ->
Arguments:
a hash table, created by HB_HASH()
key to be retrieve from the hash table;
can be of type: number, date, datetime, string, pointer
Returns:
Either the value within the hash table for the given key.
An array access error occurs of the key is not found
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HGETDEF()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Returns a hash value, or a default value if the key is not present
Syntax:
HB_HGETDEF( , , [] ) ->
Arguments:
a hash table, created by HB_HASH()
key to be retrieve from the hash table;
can be of type: number, date, datetime, string, pointer
a default value to be returned if the
hash table does not contain the key
Returns:
Either the value within the hash table for the given key,
or the default value.
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HHASKEY()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Determines whether a hash table has an entry with a give key
Syntax:
HB_HHASKEY( , ) -> lExists
Arguments:
a hash table, created by HB_HASH()
a key value to be queried for;
can be of type: number, date, datetime, string, pointer
Returns:
A logical value indicating whether the key exists within the hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HKEYAT()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Gets a hash table key at a given position
Syntax:
HB_HKEYAT( , ) ->
Arguments:
a hash table, created by HB_HASH()
the position of an entry within the hash table that will
be returned
Returns:
The key at the given position of the hash table;
the type will be one: number, date, datetime, string, pointer
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HKEYS()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Returns an array of the keys of a hash table
Syntax:
HB_HKEYS( ) ->
Arguments:
a hash table, created by HB_HASH()
Returns:
An array of all the hash table keys
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HMERGE()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Merges a source hash table into a destination hash table
Syntax:
HB_HMERGE( , , | ) ->
Arguments:
a destination hash table, created by HB_HASH()
a source hash table, created by HB_HASH()
a code block that will be evaluated for each entry within the
source hash table; the code block will be passed the entry key, value and
position; if the code block returns a true value, the entry will be added to
the destination hash table
the position of an entry within the source hash table that will
be appended to the destination hash table
TODO: the source code passes either a number or HB_HASH_UNION; research this
Returns:
The destination hash table with the contents of the source hash table merged
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HPAIRAT()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Returns a two-dimensional array of a hash table entry key/value pair
Syntax:
HB_HPAIRAT( , ) ->
Arguments:
a hash table, created by HB_HASH()
the position of an entry within the hash table that will
be returned
Returns:
A two-dimensional array of the key/value pair entry of the hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HPOS()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Locates the index of a key within a hash table
Syntax:
HB_HPOS( , ) -> nPosition
Arguments:
a hash table, created by HB_HASH()
key for which its position is to be determined;
can be of type: number, date, datetime, string, pointer
Returns:
A integer number being the index position of the key within the hash table.
TODO: what is the return value if the key does not exist? zero (0)? RTE?
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HSCAN()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Scans a hash table
Syntax:
HB_HSCAN( , , [], [, [] ) -> nPosition
Arguments:
a hash table, created by HB_HASH()
to be located within the hash table
starting index, defaults to 1 if omitted
counter, defaults to (length) - is omitted
logical valuye indicating whether the comparision
is to be be exact or not
Returns:
The position of the located value within the hash table, or zero (0) if not found.
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HSET()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Sets a hash value
Syntax:
HB_HSET( , , ) ->
Arguments:
a hash table, created by HB_HASH()
the key of the entry to be set;
can be of type: number, date, datetime, string, pointer
the entry value
Returns:
The hash table
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HSETAUTOADD()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Sets the 'auto add' flag for the hash table
Syntax:
HB_HSETAUTOADD( , [] ) ->
Arguments:
a hash table, created by HB_HASH()
a logical value indicating to turn on or off
the 'auto add' flag of the hash table
Returns:
The hash table
Description:
This function is equivalent to HB_HAUTOADD() but it returns
the passed hash table rather than the old flag value
Examples:
LOCAL hsTable
// turn 'auto add' on for a new hash table
hsTable := hb_HSetAutoAdd( { "one" => 1, "two" => 2 }, .T. )
Status:
R
Compliance:
H
Files:
See also:
HB_HAUTOADD(),HB_HSETBINARY(),HB_HSETCASEMATCH()
HB_HSETBINARY()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Sets the 'binary' flag for the hash table
Syntax:
HB_HSETBINARY( , [] ) ->
Arguments:
a hash table, created by HB_HASH()
a logical value indicating to turn on or off
the 'binary' flag of the hash table
Returns:
The hash table
Description:
This function is equivalent to HB_HBINARY() but it returns
the passed hash table rather than the old flag value
Examples:
LOCAL hsTable
// turn 'binary' on for a new hash table
hsTable := hb_HSetBinary( { "one" => 1, "two" => 2 }, .T. )
Status:
R
Compliance:
H
Files:
See also:
HB_HBINARY(),HB_HSETAUTOADD(),HB_HSETCASEMATCH
HB_HSETCASEMATCH()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Sets the 'case match' flag for the hash table
Syntax:
HB_HSETCASEMATCH( , [] ) ->
Arguments:
a hash table, created by HB_HASH()
a logical value indicating to turn on or off
the 'case match' flag of the hash table
Returns:
The hash table
Description:
This function is equivalent to HB_HCASEMATCH() but it returns
the passed hash table rather than the old flag value
Examples:
LOCAL hsTable
// turn 'case match' on for a new hash table
hsTable := hb_HSetCaseMatch( { "one" => 1, "two" => 2 }, .T. )
Status:
R
Compliance:
H
Files:
See also:
HB_HCASEMATCH(),HB_HSETAUTOADD(),HB_HSETBINARY
HB_HSORT()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Reorganizes the internal list of the hash table to be sorted
Syntax:
HB_HSORT( ) ->
Arguments:
a hash table, created by HB_HASH()
Returns:
The hash table sorted
TODO: is the original table altered?
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HVALUEAT()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Gets/sets a hash value at a given position
Syntax:
HB_HVALUEAT( , , [] ) ->
Arguments:
a hash table, created by HB_HASH()
the position of an entry within the hash table that will
be returned
a new value to be assigned to the hash table at the given
position
Returns:
The existing value, or the new value if it is given
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_HVALUES()
Lang:
hashes.txt
Component:
harbour
Doc. source:
.\doc\en\hashes.txt
Template:
Function
Category:
API
Subcategory:
Hash table
Oneliner:
Returns an array of the values of a hash table
Syntax:
HB_HVALUES( ) ->
Arguments:
a hash table, created by HB_HASH()
Returns:
An array of all the hash values
Description:
Examples:
Status:
R
Compliance:
H
Files:
See also:
HB_IDLEADD()
Lang:
idle.txt
Component:
harbour
Doc. source:
.\doc\en\idle.txt
Template:
Function
Category:
API
Subcategory:
Idle states
Oneliner:
Adds the background task.
Syntax:
HB_IDLEADD( ) --> nHandle
Arguments:
is a codeblock that will be executed during idle states.
There are no arguments passed to this codeblock during evaluation.
Returns:
The handle (an integer value) that identifies the task. This
handle can be used for deleting the task.
Description:
HB_IDLEADD() adds a passed codeblock to the list of background
tasks that will be evaluated during the idle states. There is no
limit for the number of tasks.
Examples:
nTask := hb_idleAdd( {|| SayTime() } )
Status:
R
Compliance:
Harbour extension similar to FT_ONIDLE() function available
in NanForum library.
Files:
src/rtl/idle.c
See also:
HB_IDLEDEL(),HB_IDLESTATE()
HB_IDLEDEL()
Lang:
idle.txt
Component:
harbour
Doc. source:
.\doc\en\idle.txt
Template:
Function
Category:
API
Subcategory:
Idle states
Oneliner:
Removes the background task from the list of tasks.
Syntax:
HB_IDLEDEL( ) -->
Arguments:
is the identifier of the task returned by the
HB_IDLEADD() function.
Returns:
NIL if invalid handle is passed or a codeblock that was
passed to HB_IDLEADD() function
Description:
HB_IDLEDEL() removes the action associated with passed identifier
from the list of background tasks. The identifer should be the
value returned by the previous call of HB_IDLEADD() function.
If specified task is defined then the codeblock is returned
otherwise the NIL value is returned.
C Prototype
#include "hbapi.h"
hb_idleReset( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_idleShutDown()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Closes all background tasks
Syntax:
C Prototype
#include "hbapi.h"
hb_idleShutDown( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_idleState()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Services a single idle state
Syntax:
C Prototype
#include "hbapi.h"
hb_idleState( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
HB_IdleState()
Lang:
idle.txt
Component:
harbour
Doc. source:
.\doc\en\idle.txt
Template:
Procedure
Category:
API
Subcategory:
Idle states
Oneliner:
Evaluates a single background task and calls the garbage collector.
Syntax:
HB_IDLESTATE()
Arguments:
None
Returns:
Description:
HB_IDLESTATE() requests the garbage collection and executes a
single background task defined by the codeblock passed with
HB_IDLEADD() function. Every call to this function evaluates a
different task in the order of task creation. There are no
arguments passed during a codeblock evaluation.
This function can be safely called even if there are no background
tasks defined.
Harbour extension similar to FT_IAMIDLE() function available
in NanForum library.
Files:
src/rtl/idle.c
See also:
HB_IDLEADD(),HB_IDLEDEL()
hb_idleState()
Lang:
idle.txt
Component:
harbour
Doc. source:
.\doc\en\idle.txt
Template:
Procedure
Category:
C level API
Subcategory:
Idle states
Oneliner:
Evaluates a single background task and calls the garbage collector.
Syntax:
void hb_idleState( void );
Arguments:
None
Returns:
Description:
hb_idleState() is a C function that requests garbage collection and
executes a single background task defined by the codeblock passed
with HB_IDLEADD() function. It also releases the CPU time slices for
platforms that require it.
Every call for this function evaluates different task in the
order of task creation. There are no arguments passed during
codeblock evaluation.
This function can be safely called even if there are no background
tasks defined.
This function is automatically called from the INKEY() function.
Examples:
Status:
R
Compliance:
H
Files:
src/rtl/idle.c
See also:
HB_IDLEADD(),HB_IDLEDEL(),HB_IDLESTATE()
HB_INETACCEPT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Wait until a socket is ready
Syntax:
HB_INETACCEPT( ) -> SOCKET
Arguments:
An INET socket
Returns:
a socket previously created / opened
Description:
Waits until a connection is available on a socket created with hb_InetServer,
returns a socket that can be used to communicate with the incoming client.
On error, NIL is returned and error code sets in the passed SOCKET.
This error can be accessed using hb_InetErrorCode() function.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETADDRESS
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get a remote server address
Syntax:
HB_INETADDRESS( ) -> cResult
Arguments:
a socket previously created / opened
Returns:
Server address
Description:
Returns a string representing the remote server address in quad dot notation,
e.g. "192.168.1.1", or the local server address if the socket is server
side.
TODO: have a version that returns a vector of 4 numbers.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCLEANUP
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Procedure
Category:
API
Subcategory:
INET
Oneliner:
Terminate Harbour INET support
Syntax:
HB_INETCLEANUP()
Arguments:
(This function has no arguments)
Returns:
Description:
Closes inet support; mainly used for Windows. Put it at the end of any program
using Inet functions, just before the program exits.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCLEARERROR
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Procedure
Category:
API
Subcategory:
INET
Oneliner:
Clear the socket error value
Syntax:
HB_INETCLEARERROR( )
Arguments:
a socket previously created / opened
Returns:
Description:
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCLEARPERIODCALLBACK
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Procedure
Category:
API
Subcategory:
INET
Oneliner:
Clear the periodic callback value of a socket
Syntax:
HB_INETCLEARPERIODCALLBACK( )
Arguments:
a socket previously created / opened
Returns:
Description:
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCLEARTIMELIMIT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Procedure
Category:
API
Subcategory:
INET
Oneliner:
Clear the time limit value of a socket
Syntax:
HB_INETCLEARTIMELIMIT( )
Arguments:
a socket previously created / opened
Returns:
Description:
Clears the default time limit of the given socket.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCLEARTIMEOUT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Procedure
Category:
API
Subcategory:
INET
Oneliner:
Clear the timeout value of a socket
Syntax:
HB_INETCLEARTIMEOUT( )
Arguments:
a socket previously created / opened
Returns:
Description:
Clears the default timeout of the given socket. Default timeout is used in all
blocking operations.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCLOSE
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Close an INET socket
Syntax:
HB_INETCLOSE( ) -> nResult
Arguments:
a socket previously created / opened
Returns:
Returns 0 on success or -1 on error; on error, the error code is set;
(actually, on success the socket error code is set to 1 -- socket closed )
Description:
Closes the socket, notifiying both ends of the communication pipe that the
connection is over.
If you have threads waiting for data to be read from
this socket, this method will make them stop waiting and return an error
(socket closed) to their callers.
The method does not destroy the socket, which can be used by subordinate
threads to check that the socket is closed, and so they should stop as soon
as they can. Don't destroy the socket unless you are sure that no other
thread is using it.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCONNECT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Connect a socket to a remote server by IP address or name
(First form) INET socket
(Second form has no return value)
Description:
Connects to a remote server described by cAddress, that can be in
quad dot notation (e.g. "192.168.1.1") or in DNS name (e.g.
"www.xharbour.org"), using the desired port.
hb_InetConnect uses "gethostbyname" C system call to
find the network address of the specified server; this means that
this call is an hybrid function doing both a DNS scan and a TCP/IP
connection. hb_InetConnect is not thread safe, and the
program must take care that two hb_InetConnect functions are never
called at the same moment from two different threads (or that
hb_InetGetHosts is not called in the same moment as an hb_InetConnect).
The second version of this function accepts a pre-built socket
as a parameter. This allows to kill asyncronously a thread waiting
for hb_InetConnect to connect, and then cleaning up the leftover
socket data. Also, it is possible to give timeout to the given SOCKET,
but this timeout will be used only in the connection phase, after that
the network address resolution is completed. Use GetHosts() and
hb_InetConnectIP for a finer timeout control.
On error, the error of the returned socket is set. The error could
be due to unavailable name resolving service, host name not valid,
host address not reachable and host reachable but port not open.
(First form) INET socket
(Second form has no return value)
Description:
Connects to a remote server described by cAddress, that can be specified
only in quad dot IPV4 notation (e.g. "127.0.0.1"), using the desired port.
This version of hb_InetConnect does not use gethostbyname, and thus is thread
safe and can be used in combination with hb_InetGetHosts to have a finer
timeout control while connecting to a server, and a finer error control.
The second version of this function accepts a pre-built socket
as a parameter. This allows to kill asyncronously a thread waiting
for hb_InetConnectIP to connect, and then cleaning up the leftover
socket data. Also, it is possible to give timeout at the given SOCKET.
On error, the error of the returned socket is set.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCOUNT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get the number of bytes last read or sent
Syntax:
HB_INETCOUNT( ) -> nResult
Arguments:
a socket previously created / opened
Returns:
Last socket operation character count
Description:
Returns the amount of characters read or written in the latest socket
operation.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCREATE
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Create an INET socket
Syntax:
HB_INETCREATE( [ ] ) -> SOCKET
Arguments:
Socket timeout (optional) TODO: what is the scale (seconds, milliseconds?)
Returns:
An INET socket
Description:
Creates the raw data of the socket, that can be passed to a asynchronous
connection function (hb_InetConnect or hb_InetConnectIP). This will prevent the
connection function from allocating some data that could be never used in
certain cases, i.e. an asynchronously detected timeout.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETCRLF
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get a CRLF sequence for internet protocols
Syntax:
HB_INETCRLF() -> cResult
Arguments:
(This function has no arguments)
Returns:
Internet CRLF sequence
Description:
Returns a CRLF sequence used in many internet protocols.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETDATAREADY
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get whether there is data ready in a socket
Syntax:
HB_INETDATAREADY( , [ ] ) -> nResult
Arguments:
a socket previously created / opened
Returns:
If there is data available 1 (one) is returned, 0 (zero) if there is no data
and -1 if there is an error.
Description:
Verifies if some data is available to be read in the socket without blocking
execution of the caller.
If nMillisecs is not given, the function returns
immediately 1 if there is some data to be read, 0 if there isn't any data and
-1 in case of error.
If nMillisecs is given, the functon will wait up to that
amount of milliseconds for data to be available; if some data arrives in the
meanwhile, the wait is immediately interrupted.
The next hb_InetRecv() function will read all the available data (up to the
required length) without blocking.
On error, hb_InetErrorCode and hb_InetErrorDesc can be use to determine what kind
of error happened.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETDGRAM
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Create a datagram socket
Syntax:
HB_INETDGRAM( [] ) -> SOCKET
Arguments:
lBroadcast
Returns:
An INET socket
Description:
Creates a datagram-oriented socket that will be able to send data and
eventually receive data. Since the socket is not bound, the program can't
retrieve the address at which this socket appaers to be, but a second
socket receiving a message sent from this one would be able to reply
correctly with a datagram that can be read from a non-bound socket.
If lBroadcast is set to .T., the routine creates a broadcast capable socket:
it will be able to receive and send broadcast messages. On most systems this
requires special user privileges.
Returns the socket, and if an error occurs, the socket error message
and code are set.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETDGRAMBIND
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Create a bound datagram socket
Syntax:
HB_INETDGRAMBIND( , [ [, ] ] ) -> SOCKET
Arguments:
Returns:
An INET socket
Description:
Creates a datagram-oriented socket and binds it to a particular port, and
eventually to a certain interface if cAddress is given and not NIL.
If lBroadcast is set to .T., the routine creates a broadcast capable socket:
it will be able to receive and send broadcast messages. On most systems this
requires special user privileges.
Returns the socket
If an error occurs, the socket error message
and code are set.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETDGRAMRECV
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get data from a datagram socket
Syntax:
HB_INETDGRAMRECV( , @ [, ] ) -> nBytesRead
Arguments:
a socket previously created / opened
is the target buffer and must be passed by reference
Returns:
Returns number of bytes read, or -1 on error
Description:
Reads at maximum nSize bytes incoming from a UDP socket, if nSize is
given, or reads at maximum cBuffer length if nSize is not given.
There isn't any guarantee that all the data required to be read is
really sent from the kernel to the application: the kernel should
just return the last complete datagram that has been received, up
to nSize bytes.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETDGRAMSEND
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Send data to a datagram socket
Syntax:
HB_INETDGRAMSEND( , , , [, ] ) -> nBytesSent
Arguments:
a socket previously created / opened
Returns:
Returns number of bytes sent, or -1 on error
Description:
Sends a datagram (a fixed length data) to a determined ip address (cAddress,
to be specified in quad-dot notation) and port.
If nSize is not specified,
all the data in cBuffer will be sent; if nSize is specified, only
the first nSize bytes of cBuffer will be sent.
There isn't any guarantee that all the data required to be written is
really sent to the socket: the calling program should check for the
numeric return and send iteratively the unsent data to complete
the message.
Anyway, the raw datagram is sent and received as once, and any data
less than the system datagram size will be sent and received
as a single item.
If the socket is created in broadcast mode, the cAddress element
can be a broadcast address.
Returns -1 on error, or the number of bytes actually sent on success.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETERRORCODE
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get the last INET error code
Syntax:
HB_INETERRORCODE( ) -> nResult
Arguments:
a socket previously created / opened
Returns:
Last error code
Description:
Returns the last error code that has been provoked by a network operation,
or 0 if none.
Error codes are the ones used for winsock or UnixSockets (they
are the same); 1 is reserved for "connection closed" message.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETERRORDESC
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get the last INET error code description
Syntax:
HB_INETERRORDESC( ) -> cResult
Arguments:
a socket previously created / opened
Returns:
System-dependant error string
Description:
Returns a string describing the last error that occurred in the socket;
the string is system dependent, and should be used only for debugging
purposes.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETFD
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
?
Syntax:
HB_INETFD( [, ] ) -> nResult
Arguments:
a socket previously created / opened
Returns:
?
Description:
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETGETALIAS
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get an array of aliases of a server
Syntax:
HB_INETGETALIAS( ) -> aHosts
Arguments:
Returns:
Array of server aliases
Description:
Returns an array containing the aliases ( CNAME DNS records ) by
which the server is currently known.
Whether this function is able
to have the complete list of aliases or not depends on the verbosity
of the DNS server.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETGETHOSTS
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get an array of IP addresses of a host
Syntax:
HB_INETGETHOSTS( ) -> aHosts
Arguments:
Returns:
An array of IP addresses
Description:
Returns an array containing all the IP addresses associated with a given
host name. The IP addressess returned by this funtion are strings in
quad dot notations, eg "192.168.1.1", and can be directly used into
hb_InetConnectIP().
cName can be any string: valid DNS names (eg.
"www.myserver.com"), locally available names (e.g. "localhost" or
windows Network Neighborhood names), or even IP addresses in quad
dot notation.
NOTE: This function is not thread safe (by design), and programmers
must be sure not to use it at the same time in two different threads,
or not to use it together with a hb_InetConnect(). If this kind of situation
should ever arise, you are advised to use a thread MUTEX.
On error, and if the server can't be found, the function returns NIL.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETGETRCVBUFSIZE
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get the socket receive buffer size
Syntax:
HB_INETGETRCVBUFSIZE( ) -> nResult
Arguments:
a socket previously created / opened
Returns:
Returns the socket receive buffer size or -1 if the socket is closed or an error occurs
Description:
Returns the socket receive buffer size or -1 if the socket is closed or an error occurs
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETGETSNDBUFSIZE
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get the socket send buffer size
Syntax:
HB_INETGETSNDBUFSIZE( ) -> nResult
Arguments:
a socket previously created / opened
Returns:
Returns the socket send buffer size or -1 if the socket is closed or an error occurs
Description:
Returns the socket send buffer size or -1 if the socket is closed or an error occurs
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETINIT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Activate Harbour INET support
Syntax:
HB_INETINIT() -> lResult
Arguments:
(This function has no arguments)
Returns:
Returns .T. or .F. whether the internal INET system was successfully initialized
Description:
Activates inet support; mainly used for winsock start up at the moment, but
could be used in the future for many other purpose. Put it at the beginning
of every program using INET functions.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETISSOCKET
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get whether a variable is a socket
Syntax:
HB_INETISSOCKET( ) -> lResult
Arguments:
a socket previously created / opened
Returns:
Returns whether the passed parameter is a socket
Description:
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETPERIODCALLBACK
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get or change the periodic callback value of a socket
a socket previously created / opened
xCallback a new periodic callback
Returns:
The previous periodic callback value
Description:
Sets or returns the socket periodic callback value
xCallback can be one of: a codeblock, an array of (...), or a (symbol)
TODO: describe these better
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETPORT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get the port a socket is bound to.
Syntax:
HB_INETPORT( ) -> cResult
Arguments:
a socket previously created / opened
Returns:
Port name the socket is bound to.
Description:
Returns the port to which this socket is bound, or the remote port if this
socket is connected with a remote host or client
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETRECV
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Read from a socket
Syntax:
HB_INETRECV( , @, [ ] ) -> nResult
Arguments:
a socket previously created / opened
is the target buffer and must be passed by reference
is the upper limit of characters to be read from the socket.
If not passed this defaults to the length of cResult
Returns:
The number of the characters read from the socket.
Description:
Reads from the socket into a buffer.
The parameter cString must be preallocated so that it has enough
space to receive the data. The routine will block the thread until some
bytes are read from the socket, the socket is closed (either from the
receiver or the sender side) or a network error occurs, whichever comes
first. In the latter cases, an error is set, and only the characters
received until premature end of communications are returned.
Notice that there is no guarantee that all the available bytes will be
read before the function returns, in fact, hb_InetRecv returns as soon it
is able to fill cString with one or more bytes. To block the current
process until the whole cString is filled (or nAmount bytes are read),
use the hb_InetRecvALL().
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETRECVALL
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Read from a socket without blocking
Syntax:
HB_INETRECVALL( , @, [ ] ) -> nResult
Arguments:
a socket previously created / opened
is the target buffer and must be passed by reference
is the upper limit of characters to be read from the socket.
If not passed this defaults to the length of cResult
Returns:
The number of the characters read from the socket. Might be
less than nAmount on premature socket closing or on network error.
Description:
This function works exactly as hb_InetRecv except that it
blocks until nAmount bytes are read, if nAmount is given, or
cString is filled for its whole length.
This function operates exactly the same way as hb_InetRecvLine, but
the "record termination" is customizable through the cBlock parameter.
If not given, this parameter defaults to the CRLF sequence.
Provided by: Marcelo Lombardo
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETRECVLINE
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Read a line from a socket
Syntax:
HB_INETRECVLINE( [, @, [, [, ]]] ) -> cResult
Arguments:
a socket previously created / opened
must be passed by reference
Returns:
Line read
Description:
Blocks the calling thread until a sequence CRLF is read from the socket.
Incremental allocation and end-of-line checking are done in an efficient
way.
If an error occurs, or if the stream is closed before a CRLF is read,
the function returns nothing and sets the socket error.
The returned string does not contain the trailing CRLF sequence, so an
empty line is effectively returned as an empty string.
If the nBytesRead parameter is given, it will contain the number of bytes
read from the socket, including the CRLF sequence, so that in normal
conditions, nResult will report a count equal to the length of the
returned string plus 2. nBytesRead will be 0 if stream is closed before
a CRLF sequence is read, and will be -1 on error.
An optional nMaxLength parameter can be given to allow a maximum character
count before the data is returned anyway. If this number is reached before
a CRLF sequence is encountered, nBytesRead will contain the value one.
Finally, a nBufSize parameter can be given. If not, memory allocation
will be increased by discrete amounts of 80 bytes. The programmer
can provide here a different allocation strategy (e.g. setting nBufSize
equal to nMaxLength, memory for reading the line will be allocated only
once, at the beginning of the function).
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETSEND
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Sent data through a socket
Syntax:
HB_INETSEND( , [, ] ) -> nResult
Arguments:
a socket previously created / opened
Returns:
The amount of data written, 0 (zero) if the socket is closed, or -1 on an error
Description:
Send data being stored in a string over the socket.
The nLength parameter can be given to allow writing only a part of
the string.
There is no guarantee that all of cBuffer will be
sent, as this is a decision that is up to the OS; this function does not
take care to ensure that the data is really sent; check
the returned number and send the part that has not been sent.
To ensure that all the data is sent before the function returns, use the
hb_InetSendAll() function.
On error, the error in the socket is set.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETSENDALL
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Send data through a socket with blocking
Syntax:
HB_INETSENDALL( , [, ] ) -> nResult
Arguments:
a socket previously created / opened
Returns:
The amount of data written, 0 (zero) if the socket is closed, or -1 on an error
Description:
This function works exactly as hb_InetSend() but it ensures that all the
data to be sent is written before returning.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETSERVER
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Create a socket bound to a port
Syntax:
HB_INETSERVER( [, [, ]] ) -> SOCKET
Arguments:
is an internal parameter and rarely needs to be passed, defaults to 10
Returns:
An INET socket
Description:
Creates a server that can accept connections from client on a certain port.
If the computer on which hb_InetServer is called has more than one logical
interface (e.g. one network card, one loopback and one PPP address),
cBindAddr can be specified to select only one of these interfaces to accept
connections for this process. This is useful when a server is present on
two networks, and the service is to be available only in one of them. Also,
the same port on other addresses is left free to be used, so you can have
different server programs running for different networks but managing
the same service. For example, an FTP server available to the internal
network could be radically different from an FTP server available for
the internet.
nListenLimit is the number of incoming connections accepted by kernel before the
kernel has the chance to report them to the application program. If
the sockets receive nListenLimit connections before accepting them
all, the nListenLimit + 1 connection will be notified to be "busy" by
the kernel. The default value of 10 is enough for even
a heavy duty server.
On error, sets error description in the newly returned socket.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETSETRCVBUFSIZE
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Set the receive buffer size of a socket
Syntax:
HB_INETSETRCVBUFSIZE( , nSize ) -> nSize
Arguments:
a socket previously created / opened
nSize
Returns:
Returns the passed nSize or -1 on error
Description:
Sets the receive buffer size of a socket
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETSETSNDBUFSIZE
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Set the send buffer size of a socket
Syntax:
HB_INETSETSNDBUFSIZE( , ) -> nSize
Arguments:
a socket previously created / opened
nSize
Returns:
Returns the passed nSize or -1 on error
Description:
Sets the send buffer size of a socket
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETSTATUS
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get the status of a socket
Syntax:
HB_INETSTATUS( ) -> nResult
Arguments:
a socket previously created / opened
Returns:
Returns 1 (one) if the socket exists, -1 if it does not
Description:
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETTIMELIMIT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get or change the time limit value of a socket
Syntax:
HB_INETTIMELIMIT( [, ) -> NIL
Arguments:
a socket previously created / opened
Returns:
Returns the previous time limit value of the socket
Description:
Sets or changes the time limit value of the socket.
Examples:
Status:
Compliance:
H
Files:
See also:
HB_INETTIMEOUT
Lang:
hbinet.txt
Component:
harbour
Doc. source:
.\doc\en\hbinet.txt
Template:
Function
Category:
API
Subcategory:
INET
Oneliner:
Get or change the timeout value of a socket
Syntax:
HB_INETTIMEOUT( [, ] ) -> nPreviousTimeout
Arguments:
a socket previously created / opened
is the new socket timeout value
Returns:
Returns the previous timeout value of the socket
Description:
Sets or changes the timeout value of the socket.
Examples:
Status:
Compliance:
H
Files:
See also:
hb_inkey()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Function
Category:
C level API
Subcategory:
Terminal
Oneliner:
Wait for keyboard input
Syntax:
C Prototype
#include "hbapigt.h"
hb_inkey( HB_BOOL bWait, double dSeconds, HB_inkey_enum event_mask ) --> ( int )iResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
hb_inkeyGet()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Function
Category:
C level API
Subcategory:
Terminal
Oneliner:
Extract the next key from the Harbour keyboard buffer
Syntax:
C Prototype
#include "hbapigt.h"
hb_inkeyGet( void ) --> ( int )iResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
hb_inkeyLast()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Function
Category:
C level API
Subcategory:
Terminal
Oneliner:
Return the value of the last key that was extracted
Syntax:
C Prototype
#include "hbapigt.h"
hb_inkeyLast( void ) --> ( int )iResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
hb_inkeyNext()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Function
Category:
C level API
Subcategory:
Terminal
Oneliner:
Return the next key without extracting it
Syntax:
C Prototype
#include "hbapigt.h"
hb_inkeyNext( void ) --> ( int )iResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
hb_inkeyPoll()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Procedure
Category:
C level API
Subcategory:
Terminal
Oneliner:
Poll the console keyboard to stuff the Harbour buffer
Syntax:
C Prototype
#include "hbapigt.h"
hb_inkeyPoll( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
hb_inkeyPut()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Procedure
Category:
C level API
Subcategory:
Terminal
Oneliner:
Inserts an inkey code into the keyboard buffer
Syntax:
C Prototype
#include "hbapigt.h"
hb_inkeyPut( int ch )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
hb_inkeyReset()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Procedure
Category:
C level API
Subcategory:
Terminal
Oneliner:
Reset the Harbour keyboard buffer
Syntax:
C Prototype
#include "hbapigt.h"
hb_inkeyReset( HB_BOOL allocate )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
HB_ISBYREF()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
Determine if a variable is passed by reference.
Syntax:
HB_ISBYREF( @ ) -->
Arguments:
@ is the variable to test; it must be passed by reference.
Returns:
a logical value indicating if the variable is passed
by reference to actual function or procedure.
Description:
This function return a logical value indicating if the variable
is passed by reference to actual function or procedure.
ATTENTION: The variable to test must be passed by reference.
If the variable is not passed by reference, the function return NIL.
This function is based on the form that Harbour manages to the
variables for reference. When a variable is passed by reference,
what receives the function or procedure is, a pointer to the
previous variable, be this the container variable of the data or
a pointer to another variable. The function observes if the
variable passed points to a common variable or to a variable
passed by reference.
Examples:
See Tests
Status:
S
Compliance:
H
Files:
Library is rtl
See also:
VALTYPE()
HB_ISSPACE()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_ISSPACE( c ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_ARRAY()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_ARRAY( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_BLOCK()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_BLOCK( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_BYREF()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_BYREF( p ) --> type & HB_IT_BYREF )>
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_DATE()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_DATE( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_DOUBLE()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_DOUBLE( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_INTEGER()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_INTEGER( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_LOGICAL()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_LOGICAL( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_LONG()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_LONG( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_MEMO()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_MEMO( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_MEMVAR()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_MEMVAR( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_NIL()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_NIL( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_NUMERIC()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_NUMERIC( p ) --> type & HB_IT_NUMERIC )>
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_OBJECT()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_OBJECT( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_OF_TYPE()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_OF_TYPE( p, t ) --> type & ~HB_IT_BYREF ) == t )>
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_POINTER()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_POINTER( p ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_STRING()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_STRING( p ) --> type & ~( HB_IT_BYREF | HB_IT_MEMOFLAG ) ) == HB_IT_STRING )>
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
HB_IS_SYMBOL()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
HB_IS_SYMBOL( p ) -->
A pointer to a new copy of the specified item parameter.
Description:
Use this function whenever the pointer needs to be accessed after
the current function returns; for example, if the pointer is to
be copied to a static variable or structure member for later access.
Compare to hb_param(), which simply gets a direct pointer to the
item on the stack.
Examples:
Status:
R
Compliance:
NA
Files:
Library is rtl
See also:
hb_param()
hb_itemParamPtr()
Lang:
hb_apiit.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apiit.txt
Template:
Function
Category:
C level API
Subcategory:
Item
Oneliner:
Syntax:
C Prototype
#include "hbapiitm.h"
hb_itemParamPtr( USHORT uiParam, int iMask ) --> ( PHB_ITEM )pResult
is the inkey code, which should be inserted into the
keyboard buffer.
Returns:
There is no return value.
Description:
Inserts an inkey code to the string buffer. The buffer is *not*
cleared in this operation. This function allows to insert such
inkey codes which are not in the range of 0 to 255. To insert more
than one code, call the function repeatedly. The zero code cannot
be inserted.
Examples:
// Stuff an Alt+PgDn key into the keyboard buffer
hb_keyPut( K_ALT_PGDN )
HB_LANGMESSAGE() return the text associated with the code .
Description:
HB_LANGMESSAGE() is similar to NATIONMSG() but give access to the
whole list of language messages: Day and month names, generic error
messages, internal errors, and others...
Use the header file hblang.ch for a list of base values for .
Return the name of the current language module in use
Syntax:
HB_LANGNAME() --> cLangName
Arguments:
None.
Returns:
Name of the current language in use
Description:
This function return the current name of the language module in use.
Examples:
REQUEST HB_LANG_PT
REQUEST HB_LANG_RO
REQUEST HB_LANG_ES
PROCEDURE Main()
HB_LANGSELECT( "PT" ) // Default language is now Portuguese
? CDOW( DATE() ) //Segunda-feira
? "Current language is ", HB_LANGNAME() // Portuguese
? "Old language id selected is ", HB_LANGSELECT() // PT
HB_LANGSELECT( "RO" ) // Default language is now Romanian
? CMONTH( DATE() ) // Mai
? "Old language id selected is ", HB_LANGSELECT() // RO
HB_LANGSELECT( "ES" ) // Default language is now Spanish
? "Current language is ",HB_LANGNAME() // Spanish
? CMONTH( DATE() ) // Mayo
? CDOW( DATE() ) // Lunes
RETURN
Status:
R
Compliance:
H
Files:
Library are rtl, lang
See also:
HB_LANGSELECT(),NATIONMSG()
hb_langRegister()
Lang:
hb_apiln.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apiln.txt
Template:
Function
Category:
API
Subcategory:
Language and Nation
Oneliner:
Syntax:
C Prototype
#include "hbapilng.h"
hb_langRegister( PHB_LANG lang ) --> ( HB_BOOL )bResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is lang
See also:
hb_langSelect()
Lang:
hb_apiln.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apiln.txt
Template:
Function
Category:
API
Subcategory:
Language and Nation
Oneliner:
Syntax:
C Prototype
#include "hbapilng.h"
hb_langSelect( PHB_LANG lang ) --> ( PHB_LANG )pResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is lang
See also:
HB_LANGSELECT()
Lang:
lang.txt
Component:
harbour
Doc. source:
.\doc\en\lang.txt
Template:
Function
Category:
API
Subcategory:
Language and Nation
Oneliner:
Select a specific nation message module
Syntax:
HB_LANGSELECT( [] ) --> cOldLang
Arguments:
The optional ID of the country language module.
Possible values for are below as defined in the
Lang library, sorted by language.
Language Codepage
Bulgarian 866 BG866
Bulgarian ISO-8859-5 BGISO
Bulgarian Windows-1251 BGWIN
Basque 850 EU
Catalan 850 CA
Chinese Simplified 936 ZHGB
Chinese Traditional 950 ZHB5
Croatian 852 HR852
Croatian ISO-8859-2 HRISO
Czech 852 CS852
Czech ISO-8859-2 CSISO
Czech Kamenickych CSKAM
Czech Windows-1250 CSWIN
Dutch 437 NL
English 437 EN
Esperanto 850 EO
French 850 FR
Galician 850 GL
German 850 DE
German ANSI ANSI DEWIN
Greek 737 EL
Greek ANSI Windows-1253 ELWIN
Hebrew 862 HE862
Hebrew Windows-1255 HEWIN
Hungarian 852 HU852
Hungarian CWI-2 HUCWI
Hungarian ISO-8859-2 HUISO
Hungarian Windows-1250 HUWIN
Icelandic 850 IS850
Indonesian 437 ID
Italian 437 IT
Korean 949 KO
Lithuanian Windows-1257 LT
Polish 852 PL852
Polish ISO-8859-2 PLISO
Polish Mazowia PLMAZ
Polish Windows-1250 PLWIN
Portuguese 850 PT
Romanian 852 RO
Russian 866 RU866
Russian KOI-8 RUKOI8
Russian Windows-1251 RUWIN
Serbian 852 SR852
Serbian ISO-8859-2 SRISO
Serbian Windows-1251 SRWIN
Slovenian 437 SL437
Slovenian 852 SL852
Slovenian ISO-8859-2 SLISO
Slovenian Windows-1250 SLWIN
Spanish 850 ES
Spanish ANSI ANSI ESWIN
Turkish 857 TR857
Turkish Windows-1254 TRWIN
Returns:
The old language indentifier
Description:
This function set a default language module for date/month names,
internal warnigs, NatMsg messages and internal errors. When a
Lang ID is selected all messages will be output with the current
language selected until another one is selected or the program ends.
The default language is English (cLang == "EN").
NOTE: You must REQUEST every language module you intend to use.
For example: to use the Russian RU866 language you must add the
following to your program: REQUEST HB_LANG_RU866
Examples:
REQUEST HB_LANG_PT
REQUEST HB_LANG_RO
REQUEST HB_LANG_ES
PROCEDURE Main()
HB_LANGSELECT( "PT" ) // Default language is now Portuguese
? CDOW( DATE() ) // Segunda-feira
? "Old language id selected is ", HB_LANGSELECT() // PT
HB_LANGSELECT( "RO" ) // Default language is now Romanian
? CMONTH( DATE() ) // Mai
? "Old language id selected is ", HB_LANGSELECT() // RO
HB_LANGSELECT( "ES" ) // Default language is now Spanish
? CMONTH( DATE() ) // Mayo
? CDOW( DATE() ) // Lunes
RETURN
C Prototype
#include "hbapi.h"
hb_macroTextValue( PHB_ITEM pItem )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_macroYYParse()
Lang:
hb_macro.txt
Component:
harbour
Doc. source:
.\doc\en\hb_macro.txt
Template:
Function
Category:
C level API
Subcategory:
Macro
Oneliner:
Syntax:
C Prototype
#include "hbmacro.h"
hb_macroYYParse( HB_MACRO_PTR pMacro ) --> ( int )iResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is macro
See also:
HB_MATHERBLOCK()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
API
Subcategory:
Math
Oneliner:
Set/Get math error handling codeblock
Syntax:
HB_MATHERBLOCK( [] ) -->
Arguments:
Returns:
is the current error handler codeblock
Description:
Examples:
Status:
R
Compliance:
Files:
Library is rtl
See also:
HB_MATHERMODE()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
API
Subcategory:
Math
Oneliner:
Set/Get math error handling mode
Syntax:
HB_MATHERMODE( [] ) -->
Arguments:
[] new math error handling mode, one of the following
constants, defined in hbmath.ch:
HB_MATH_ERRMODE_DEFAULT
HB_MATH_ERRMODE_CDEFAULT
HB_MATH_ERRMODE_USER
HB_MATH_ERRMODE_USERDEFAULT
HB_MATH_ERRMODE_USERCDEFAULT
Returns:
old math error handling mode
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbmath.ch
Library is rtl
See also:
hb_mathGetErrMode()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
C level API
Subcategory:
Math
Oneliner:
get math error handling mode
Syntax:
C Prototype
#include "hbmath.h"
hb_mathGetErrMode( void ) --> imode
Arguments:
Returns:
imode math error handling mode
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbmath.h
Library is rtl
See also:
hb_mathSetErrMode()
hb_mathGetHandler()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
C level API
Subcategory:
Math
Oneliner:
get current Harbour math error handler
Syntax:
C Prototype
#include "hbmath.h"
hb_mathGetHandler( void ) --> HB_MATH_HANDLERPROC handlerproc
Arguments:
handlerproc custom math handler
typedef int (* HB_MATH_HANDLERPROC)(HB_MATH_EXCEPTION * err)
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbmath.h
Library is rtl
See also:
hb_mathGetLastError()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
C level API
Subcategory:
Math
Oneliner:
get the last math lib error
Syntax:
C Prototype
#include "hbmath.h"
hb_mathGetLastError( HB_MATH_EXCEPTION * phb_exc )
--> int iMathErrorType
Arguments:
phb_exc pointer to HB_MATH_EXCEPTION structure, if not NULL,
the structure will be filled with information about the
last math error:
typedef struct _HB_MATH_EXCEPTION {
int type; // Math error type, is one of the constants
// HB_MATH_ERR_xxx defined in hbmath.ch
char *funcname; // Pointer to name of the math C RTL routine
// that caused the error.
char *error; // Pointer to error description.
double arg1; // First and
double arg2; // Second double argument to the math routine.
double retval; // Corrected return value for the math routine.
int retvalwidth; // Width and
int retvaldec; // Decimals of the corrected return value,
// both default to -1
int handled; // 1, if the math error is already corrected,
// 0 otherwise.
} HB_MATH_EXCEPTION;
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbmath.h
Library is rtl
See also:
hb_mathIsMathErr()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
C level API
Subcategory:
Math
Oneliner:
Check if harbour math error handling is available
Syntax:
C Prototype
#include "hbmath.h"
hb_mathIsMathErr( void ) --> int iIsMathHandler
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbmath.h
Library is rtl
See also:
hb_mathResetError()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Procedure
Category:
C level API
Subcategory:
Math
Oneliner:
Reset the internal math error information structure
Syntax:
C Prototype
#include "hbmath.h"
hb_mathResetError( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbmath.h
Library is rtl
See also:
hb_mathSetErrMode()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
C level API
Subcategory:
Math
Oneliner:
set math error handling mode
Syntax:
C Prototype
#include "hbmath.h"
hb_mathSetErrMode( int imode ) --> int ioldmode
Arguments:
imode math error handling mode, one of the following
constants, defined in hbmath.ch:
HB_MATH_ERRMODE_DEFAULT
HB_MATH_ERRMODE_CDEFAULT
HB_MATH_ERRMODE_USER
HB_MATH_ERRMODE_USERDEFAULT
HB_MATH_ERRMODE_USERCDEFAULT
Convert a DOS(OEM) Character to a WINDOWS (ANSI) based character
Syntax:
HB_OEMTOANSI( ) --> cDosString
Arguments:
DOS (OEM) string to convert to WINDOWS (ANSI) String
Returns:
WINDOWS based string
Description:
This function converts each character in to the
corresponding character in the Windows (ANSI) character set. The
character expression should contain characters from the
OEM character set. If a character in doesn't have a ANSI
equivalent, the character is remains the same.
Examples:
? HB_OEMTOANSI( "Harbour" )
Status:
R
Compliance:
H
Files:
Library is rtl
See also:
HB_ANSITOOEM()
hb_param()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a direct pointer to an item parameter
Syntax:
C Prototype
#include "hbapi.h"
hb_param( int iParam, int iMask ) --> ( PHB_ITEM ) pResult
Arguments:
The 1-based parameter to retrieve.
Returns:
hb_param() returns a direct pointer to an item on the eval stack.
Description:
This item will be removed (set to NIL) after a function cleanup,
so if the item needs to survive the current function (e.g. copied
to a static) you should use hb_itemParam instead.
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_itemParam()
hb_parc()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a string parameter
Syntax:
C Prototype
#include "hbapi.h"
hb_parc( int iParam, ... ) --> ( char * )pszResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_parclen()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a string parameter length
Syntax:
C Prototype
#include "hbapi.h"
hb_parclen( int iParam, ... ) --> ( ULONG )ulResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_parcsiz()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a by-reference string parameter length, including terminator
Syntax:
C Prototype
#include "hbapi.h"
hb_parcsiz( int iParam, ... ) --> ( ULONG )ulResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_pards()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a date as a string yyyymmdd
Syntax:
C Prototype
#include "hbapi.h"
hb_pards( int iParam, ... ) --> ( char * )pszResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_pardsbuff()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a date as a string yyyymmdd
Syntax:
C Prototype
#include "hbapi.h"
hb_pardsbuff( char * szDate, int iParam, ... ) --> ( char * )pszResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_parinfa()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve length or element type of an array parameter
Syntax:
C Prototype
#include "hbapi.h"
hb_parinfa( int iParamNum, ULONG uiArrayIndex ) --> ( ULONG )ulResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_parinfo()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Determine the param count or data type
Syntax:
C Prototype
#include "hbapi.h"
hb_parinfo( int iParam ) --> ( int )iResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_parl()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a logical parameter as an int
Syntax:
C Prototype
#include "hbapi.h"
hb_parl( int iParam, ... ) --> ( int )iResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_parnd()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a numeric parameter as a double
Syntax:
C Prototype
#include "hbapi.h"
hb_parnd( int iParam, ... ) --> ( double )dResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_parni()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a numeric parameter as a integer
Syntax:
C Prototype
#include "hbapi.h"
hb_parni( int iParam, ... ) --> ( int )iResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_parnl()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a numeric parameter as a long
Syntax:
C Prototype
#include "hbapi.h"
hb_parnl( int iParam, ... ) --> ( long )lResult
Arguments:
<...>
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_pcount()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns the number of supplied parameters
Syntax:
C Prototype
#include "hbapi.h"
hb_pcount( void ) --> ( int )iResult
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_pcount() --> ( ( int ) hb_stack.pBase->item.asSymbol.paramcnt )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_procname()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieve a procedure name into a buffer
Syntax:
C Prototype
#include "hbapi.h"
hb_procname( int iLevel, char * szName ) --> ( char * )pszResult
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
HB_PVALUE()
Lang:
hvm.txt
Component:
harbour
Doc. source:
.\doc\en\hvm.txt
Template:
Function
Category:
API
Subcategory:
Application
Oneliner:
Retrieves the value of an argument.
Syntax:
HB_PVALUE( ) -->
Arguments:
A number that indicates the argument to check.
Returns:
Returns the value stored by an argument.
Description:
This function is useful to check the value stored in an argument.
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retclen( szText, ulLen ) --> hb_itemPutCL( &hb_stack.Return, szText, ulLen )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retd()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a date
Syntax:
C Prototype
#include "hbapi.h"
hb_retd( long lYear, long lMonth, long lDay )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retd( lYear, lMonth, lDay ) --> hb_itemPutD( &hb_stack.Return, lYear, lMonth, lDay )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retdl()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a long value as a julian date
Syntax:
C Prototype
#include "hbapi.h"
hb_retdl( long lJulian )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retdl( lJulian ) --> hb_itemPutDL( &hb_stack.Return, lJulian )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retds()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a date, must use yyyymmdd format
Syntax:
C Prototype
#include "hbapi.h"
hb_retds( char * szDate )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retds( szDate ) --> hb_itemPutDS( &hb_stack.Return, szDate )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retl()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a logical integer
Syntax:
C Prototype
#include "hbapi.h"
hb_retl( int iTrueFalse )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retl( iLogical ) --> hb_itemPutL( &hb_stack.Return, iLogical ? HB_TRUE : HB_FALSE )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retnd()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a double
Syntax:
C Prototype
#include "hbapi.h"
hb_retnd( double dNumber )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retnd( dNumber ) --> hb_itemPutND( &hb_stack.Return, dNumber )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retndlen()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a double, with specific width and decimals
Syntax:
C Prototype
#include "hbapi.h"
hb_retndlen( double dNumber, int iWidth, int iDec )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retndlen( dNumber, iWidth, iDec ) --> hb_itemPutNDLen( &hb_stack.Return, dNumber, iWidth, iDec )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retni()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a integer number
Syntax:
C Prototype
#include "hbapi.h"
hb_retni( int iNumber )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retni( iNumber ) --> hb_itemPutNI( &hb_stack.Return, iNumber )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retnilen()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a integer number, with specific width
Syntax:
C Prototype
#include "hbapi.h"
hb_retnilen( int iNumber, int iWidth )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retnilen( iNumber, iWidth ) --> hb_itemPutNILen( &hb_stack.Return, iNumber, iWidth )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retnl()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a long number
Syntax:
C Prototype
#include "hbapi.h"
hb_retnl( long lNumber )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retnl( lNumber ) --> hb_itemPutNL( &hb_stack.Return, lNumber )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retnlen()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a double, with specific width and decimals
Syntax:
C Prototype
#include "hbapi.h"
hb_retnlen( double dNumber, int iWidth, int iDec )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retnlen( dNumber, iWidth, iDec ) --> hb_itemPutNLen( &hb_stack.Return, dNumber, iWidth, iDec )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_retnllen()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Returns a long number, with specific width
Syntax:
C Prototype
#include "hbapi.h"
hb_retnllen( long lNumber, int iWidth )
Arguments:
Returns:
Description:
Note that when HB_API_MACROS is defined, this function is replaced with
a macro: hb_retnllen( lNumber, iWidth ) --> hb_itemPutNLLen( &hb_stack.Return, lNumber, iWidth )
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_SetBuffer()
Lang:
hbziparc.txt
Component:
hbziparc
Doc. source:
hbziparc\doc\en\hbziparc.txt
Template:
Category:
Zip Functions
Subcategory:
Oneliner:
Syntax:
hb_SetBuffer( [], [], [] ) --> NIL
Arguments:
The size of the write buffer.
The size of the extract buffer.
The size of the read buffer.
Returns:
This function always returns NIL.
Description:
This function set the size of the internal buffers for write/extract/read
operation.
If the size of the buffer is smaller then the default, the function
will automatically use the default values, which are 65535/16384/32768
respectively.
This function be called before any of the compression/decompression
functions.
Examples:
hb_SetBuffer( 100000, 115214, 65242 )
Status:
R
Compliance:
This function is a Harbour extension
Files:
Library is hbziparc
See also:
HB_SETCODEPAGE()
Lang:
lang.txt
Component:
harbour
Doc. source:
.\doc\en\lang.txt
Template:
Function
Category:
API
Subcategory:
Language and Nation
Oneliner:
Select the active code page by language ID
Syntax:
HB_SETCODEPAGE( [] ) --> cOldLang
Arguments:
The optional ID of the country language module.
Possible values for are below as defined in the
Codepage library, sorted by language.
Language Codepage
Bulgarian 866 BG866
Bulgarian ISO-8859-5 BGISO
Bulgarian MIK BGMIK
Bulgarian Windows-1251 BGWIN
Croatian 437 HR437
Croatian 852 HR852
Croatian Windows-1250 HR1250
Czech 852 CS852
Czech ISO-8859-2 CSISO
Czech KAM CSKAM
Czech Windoes-1250 CSWIN
English 437 EN
French 850 FR
German 850 DE
German ISO-8859-1 DEWIN
Greek 737 EL
Greek Windows-1253 ELWIN
Hungarian (ntxhu852) 852 HU852
Hungarian (sixhu852) 852 HU852S
Hungarian (ntxhu852) ISO-8859-2 HUISO
Hungarian (sixhu852) ISO-8859-2 HUISOS
Hungarian (ntxhu852) Windows-1250 HUWIN
Hungarian (sixhu852) Windows-1250 HUWINS
Italian 437 IT437
Italian 850 IT850
Italian ISO-8859-1b ITISB
Italian ISO-8859-1 ITISO
Lithuanian Windows-1257 LT
Polish 852 PL852
Polish ISO-8859-2 PLISO
Polish Mazowia PLMAZ
Polish Windows-1250 PLWIN
Portuguese 850 PT850
Portuguese ISO-8859-1 PTISO
Russian 866 RU866
Russian KOI-8 RUKOI8
Russian Windows-1251 RU1251
Serbian Windows-1251 SRWIN
Slovak 852 SK852
Slovak ISO-8859-2 SKISO
Slovak Kamenicky SKKAM
Slovak Windows-1250 SKWIN
Slovenian 437 SL437
Slovenian 852 SL852
Slovenian ISO-8859-2 SLISO
Slovenian Windows-1250 SLWIN
Spanish 850 ES
Spanish ISO-8859-1 ESWIN
Spanish Modern ISO-8859-1 ESMWIN
Swedish 850 SV850
Swedish (Clipper) 437 SVCLIP
Swedish ISO-8859-1 SVWIN
Turkish 857 TR857
Turkish Windows-1254 TRWIN
Ukrainian 866 UA866
Ukrainian KOI-8U UAKOI8
Ukrainian Windows-1251 UA1251
Returns:
The old language indentifier
Description:
HB_SETCODEPAGE() set the active code page use by Harbour for
sorting and comparing strings. The default code page use ASCII
order (cLang == "EN").
NOTE: You must REQUEST every code page module you intend to use.
For example: to use the Russian RU866 code page you must add the
following to your program: REQUEST HB_CODEPAGE_RU866
Examples:
REQUEST HB_CODEPAGE_HU852
PROCEDURE Main()
LOCAL cTxt := CHR( 71 ) + " > " + CHR( 144 ) + " is"
? HB_SETCODEPAGE() // EN
? cTxt, CHR( 71 ) > CHR( 144 ) // G > É is .F.
? HB_SETCODEPAGE( "HU852" ) // EN
? cTxt, CHR( 71 ) > CHR( 144 ) // G > É is .T.
? HB_SETCODEPAGE( "EN" ) // HU852
? cTxt, CHR( 71 ) > CHR( 144 ) // G > É is .F.
RETURN
an Code block that contains an function that will be performed
when the need of changing disk are need.
Returns:
It always returns True
Description:
This function will set an codeblock that will be evaluated every time
that an changedisk event is necessary. receives nDisk as a
code block param that corresponds to the diskette number to be processed.
Set this function before opening archives that are in removable media.
This block will be released, when the caller finish it job.
Examples:
hb_SetDiskZip( {| nDisk | Alert( "Please insert disk no " + Str( nDisk, 3 ) ) } )
Status:
Compliance:
This function is a Harbour extension
Files:
Library is hbziparc
See also:
hb_setInitialize()
Lang:
hb_set.txt
Component:
harbour
Doc. source:
.\doc\en\hb_set.txt
Template:
Procedure
Category:
C level API
Subcategory:
Environment
Oneliner:
Syntax:
C Prototype
#include "hbset.h"
hb_setInitialize( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is rtl
See also:
HB_SetKeyCheck()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Events
Oneliner:
Implements common hot-key activation code
Syntax:
HB_SetKeyCheck( [, ][, ][, ] )
Arguments:
is a numeric key value to be tested code-block, if executed
.. are optional parameters that will be passed to the code-block
Returns:
True if there is a hot-key associated with and it was executed;
otherwise False
If there is a hot-key association (before checking any condition):
- if there is a condition-block, it is passed one parameter -
- when the hot-key code-block is called, it is passed 1 to 4 parameters,
depending on the parameters passed to HB_SetKeyCheck(). Any
parameters so passed are directly passed to the code-block, with an
additional parameter being
Description:
HB_SetKeyCheck() is intended as a common interface to the SetKey()
functionality for such functions as ACHOICE(), DBEDIT(), MEMOEDIT(),
ACCEPT, INPUT, READ, and WAIT
Examples:
// within ReadModal()
IF HB_SetKeyCheck( K_ALT_X, GetActive() )
... // some other processing
ENDIF
// within TBrowse handler
CASE HB_SetKeyCheck( nInkey, oTBrowse )
RETURN
CASE nInKey == K_ESC
... // some other processing
Status:
R
Compliance:
H
Files:
Library is rtl
See also:
SETKEY(),HB_SETKEYSAVE()
hb_setkeyExit()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Procedure
Category:
C level API
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype
#include "hbapigt.h"
hb_setkeyExit( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
HB_SetKeyGet()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Events
Oneliner:
Determine a set-key code block and condition-block
Syntax:
HB_SETKEYGET( [, ] )
Arguments:
is an numeric key value
is an optional return-parameter
Returns:
Current assigned action-block
Description:
The HB_SetKeyGet() function returns the current code-block assigned to
a key, and optionally assigns the condition-block to the
return-parameter
Examples:
LOCAL bOldF10, bOldF10Cond
bOldF10 := HB_SetKeyGet( K_F10, @bOldF10Cond )
... // some other processing
SetKey( K_F10, bOldF10, bOldF10Cond )
Status:
R
Compliance:
H
Files:
Library is rtl
See also:
SETKEY(),HB_SETKEYSAVE(),HB_SETKEYCHECK()
hb_setkeyInit()
Lang:
hb_apigt.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apigt.txt
Template:
Procedure
Category:
C level API
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype
#include "hbapigt.h"
hb_setkeyInit( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is gt* (ie. gtdos)
See also:
HB_SETKEYSAVE()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Events
Oneliner:
Returns a copy of internal set-key list, optionally overwriting
Syntax:
HB_SETKEYSAVE( [ ] )
Arguments:
is an optional set-key list from a previous call to
HB_SetKeySave(), or NIL to clear current set-key list
Returns:
Current set-key list
Description:
HB_SetKeySave() is designed to act like the set() function which
returns the current state of an environment setting, and optionally
assigning a new value. In this case, the "environment setting" is the
internal set-key list, and the optional new value is either a value
returned from a previous call to SetKeySave() - to restore that list,
or the value of NIL to clear the current list.
Examples:
LOCAL aKeys := HB_SetKeySave( NIL ) // removes all current set=keys
... // some other processing
HB_SetKeySave( aKeys )
Status:
R
Compliance:
H
Files:
Library is rtl
See also:
SETKEY()
hb_setListenerAdd()
Lang:
hb_set.txt
Component:
harbour
Doc. source:
.\doc\en\hb_set.txt
Template:
Function
Category:
C level API
Subcategory:
Environment
Oneliner:
Syntax:
C Prototype
#include "hbset.h"
hb_setListenerAdd( PHB_SET_LISTENER_CALLBACK callback ) --> int
Arguments:
A pointer to a function taking two enum parameters and returning
no value. The first parameter identifies the SET parameter that is
to be changed and the second parameter identifies whether the call
is from before or after the value is changed. The callback function
will be called twice whenever a SET parameter is changed using the
Harbour SET function. The first call takes place before the SET
value is changed and the second one is after the SET parameter has
been changed.
Returns:
An integer value representing the callback handle, in case the
caller needs to deactivate the callback function.
Description:
This function allows a subsystem that needs to track the status
of some SET parameters to be notified whenever a SET parameter gets
changed.
Examples:
void callback_function( HB_set_enum set, HB_set_listener_enum when )
{
printf("\nCalled for SET parameter %d %s changing.",
set, (when ? "after" : "before"));
}
int handle = hb_setListenerAdd( callback_function );
Status:
R
Compliance:
NA
Files:
Library is rtl
See also:
hb_setListenerRemove()
hb_setListenerNotify()
Lang:
hb_set.txt
Component:
harbour
Doc. source:
.\doc\en\hb_set.txt
Template:
Function
Category:
C level API
Subcategory:
Environment
Oneliner:
Syntax:
C Prototype
#include "hbset.h"
hb_setListenerNotify( HB_set_enum set, HB_set_listener_enum
when ) --> int
Arguments:
The number of the SET parameter that is to be or was changed.
Set to HB_SET_LISTENER_BEFORE when called before the SET parameter
is to be changed and set to HB_SET_LISTENER_AFTER when called
after the SET parameter has been changed.
Returns:
Description:
This function notifies all SET listener callback functions. It
must be called any time you change the value of a SET parameter
directly instead of using the Harbour SET function. Both before
and after the change.
C Prototype
#include "hbset.h"
hb_setListenerRemove( int handle ) --> int
Arguments:
The handle for the SET listener callback function to be removed.
Returns:
The handle if the callback function could not be located or the
negative value of the handle if the callback function was removed.
Description:
This function removes a SET listener callback function.
Examples:
int handle = hb_setListenerAdd( callback_function );
...
hb_setListenerRemove( handle );
Status:
R
Compliance:
NA
Files:
Library is rtl
See also:
hb_setListenerAdd()
HB_SETMACRO()
Lang:
macro.txt
Component:
harbour
Doc. source:
.\doc\en\macro.txt
Template:
Function
Category:
API
Subcategory:
Macro
Oneliner:
Enable/disable the macro compiler runtime features.
Syntax:
HB_SETMACRO( , [] ) -->
Arguments:
One of the HB_SM_* constants defined in set.ch.
.T. to enable or .F. to disable a feature
Returns:
HB_SETMACRO() return the old state of requested feature.
Description:
This function enables or disables some features of the macro
compiler. The Harbour is extending the macro features compared
to an original set available in CA-Cl*pper. Enabling/disabling
some of them allows to keep strict CA-Cl*pper compatibility.
Available features are:
HB_SM_HARBOUR - enables harbour extensions:
operators: ++, --, +=, -=, *=, /=, ^=
objects: assigments to an instance variable
HB_SM_XBASE - enables other Xbase++ dialects extensions:
expanding of expresions lists
HB_SM_SHORTCUTS - enables optimized evaluation of
logical operators (.and., .or.)
HB_SM_PREPROC - enables preprocessing of commands
This is meaningfull if Harbour is compiled with
HB_MACRO_STATEMENTS flag
Translate a string from one code page to the other
Syntax:
HB_TRANSLATE( , [], [] ) --> cDstText
Arguments:
Is the source string to translate.
Is the optional character code page ID of the source
string. If not specified, the default code page is used.
Is the optional character code page ID of the destination
string. If not specified, the default code page is used.
Returns:
HB_TRANSLATE() return destination string converted from the source
string.
Description:
HB_TRANSLATE() try to convert a source string from one code page
into the other. If a code page ID is not recognized, or not linked
in, the default code page is used. HB_TRANSLATE() is used usually
to convert between the Dos and the Windows code pages of the same
language.
NOTE: If the source code page and target code page does not have
the same number of characters, a translation can not be done and
the destination string is a copy of the source string.
NOTE: You must REQUEST every code page module you intend to use.
For example: to use the Russian RU866 code page you must add the
following to your program: REQUEST HB_CODEPAGE_RU866
Name of the zip file to extract
Code block to execute while extracting
Toggle to create directory if needed
Password to use to extract files
Path to extract the files to - mandatory
| A File or Array of files to extract - mandatory
Code block for File Progress
Returns:
.T. if all file was successfully restored, otherwise .F.
Description:
This function restores all files contained inside the .
If the extension is omitted, .zip will be assumed. If a file already
exists, it will be overwritten.
If is used, every time the file is opened to compress it
will evaluate bBlock. Parameters of bBlock are cFile and nPos.
The is a mandatory parameter. Set to ".\" to extract to the
current directory
If or are not provided, no files will be extracted!
Make sure you provide the file or files you want extracted
If is used, an Code block is evaluated, showing the total
of that file has being processed.
The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) }
Examples:
PROCEDURE Main()
aExtract := hb_GetFilesInZip( "test.zip" ) // extract all files in zip
IF hb_UnzipFile( "test.zip",,,, ".\", aExtract )
QOut( "File was successfully extracted" )
ENDIF
aExtract := hb_GetFilesInZip( "test2.zip" ) // extract all files in zip
IF hb_UnzipFile( "test2.zip", {| cFile | QOut( cFile ) },,, ".\", aExtract )
QOut( "File was successfully extracted" )
ENDIF
RETURN
Status:
R
Compliance:
This function is a Harbour extension
Files:
Library is hbziparc
See also:
HB_VALTOSTR()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Converts any scalar type to a string.
Syntax:
HB_VALTOSTR( ) --> cString
Arguments:
is any scalar argument.
Returns:
A string representation of using default
conversions.
Description:
HB_VALTOSTR can be used to convert any scalar value to a string.
Examples:
? HB_VALTOSTR( 4 )
? HB_VALTOSTR( "String" )
Status:
R
Compliance:
H
Files:
Library is rtl
See also:
STR()
hb_verBuildInfo()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Procedure
Category:
C level API
Subcategory:
Extend
Oneliner:
Display harbour, compiler, and platform versions to standard console
Syntax:
C Prototype
#include "hbapi.h"
hb_verBuildInfo( void )
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Library is vm
See also:
hb_verCompiler()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Retrieves a newly allocated buffer containing compiler version
The name of the zip files from where the files will be deleted
An File to be removed
_or_
An Array of Files to be removed
_or_
The Position of the file to be removed
Returns:
If the files are deleted, it will return .T.; otherwise
it will return .F. in the following cases: Spanned Archives; the file(s)
could not be found in the zip file.
Description:
This function removes files from an Zip archive.
Examples:
? "has the file zipnew.i been deleted ", iif( hb_ZipDeleteFiles( "\test23.zip", "zipnew.i" ), "Yes", "No" )
Status:
R
Compliance:
This function is a Harbour extension
Files:
Library is hbziparc
See also:
hb_ZipFile()
Lang:
hbziparc.txt
Component:
hbziparc
Doc. source:
hbziparc\doc\en\hbziparc.txt
Template:
Category:
Zip Functions
Subcategory:
Oneliner:
Create a zip file
Syntax:
hb_ZipFile( , | , ,
, , , , ,
) --> lCompress
Arguments:
Name of the zip file to create
Name of a file to Compress, Drive and/or path
can be used
_or_
An array containing files to compress, Drive and/or path
can be used
Compression level ranging from 0 to 9
Code block to execute while compressing
Toggle to overwrite the file if exists
Password to encrypt the files
Toggle to store the path or not
Toggle to store the Drive letter and path or not
Code block for File Progress
Returns:
.T. if file was create, otherwise .F.
Description:
This function creates a zip file named . If the extension
is omitted, .zip will be assumed. If the second parameter is a
character string, this file will be added to the zip file. If the
second parameter is an array, all file names contained in
will be compressed.
If is used, it determines the compression type where 0 means
no compression and 9 means best compression.
If is used, every time the file is opened to compress it
will evaluate bBlock. Parameters of bBlock are cFile and nPos.
If is used, it toggles to overwrite or not the existing
file. Default is to overwrite the file,otherwise if is false
the new files are added to the .
If is used, all files that are added to the archive are encrypted
with the password.
If is used, it tells the path should also be stored with
the file name. Default is false.
If is used, it tells thats the Drive and path should also be stored
with the file name. Default is false.
If is used, an Code block is evaluated, showing the total
of that file has being processed.
The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) }
Name of the zip file
Name of a file to Compress, Drive and/or path
can be used
_or_
An array containing files to compress, Drive and/or path
can be used
Compression level ranging from 0 to 9
Code block to execute while compressing
Toggle to overwrite the file if exists
Password to encrypt the files
Toggle to store the path or not
Toggle to store the Drive letter and path or not
Code block for File Progress
Returns:
.T. if file was create, otherwise .F.
Description:
This function creates a zip file named . If the extension
is omitted, .zip will be assumed. If the second parameter is a
character string, this file will be added to the zip file. If the
second parameter is an array, all file names contained in
will be compressed. Also, the use of this function is for creating
backup in removable media like an floppy drive/zip drive.
If is used, it determines the compression type where 0 means
no compression and 9 means best compression.
If is used, every time the file is opened to compress it
will evaluate bBlock. Parameters of bBlock are cFile and nPos.
If is used , it toggles to overwrite or not the existing
file. Default is to overwrite the file, otherwise if is false
the new files are added to the .
If is used, all files that are added to the archive are encrypted
with the password.
If is used, it tells thats the path should also be stored with
the file name. Default is false.
If is used, it tells thats the Drive and path should also be stored
with the file name. Default is false.
If is used, an Code block is evaluated, showing the total
of that file has being processed.
The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) }
Before calling this function, Set an Changedisk codeblock by calling
the hb_SetDiskZip().
Name of the zip file
Name of a file to Compress, Drive and/or path
can be used
_or_
An array containing files to compress, Drive and/or path
can be used
Compression level ranging from 0 to 9
Code block to execute while compressing
Toggle to overwrite the file if exists
Password to encrypt the files
Size of the archive, in bytes. Default is 1457664 bytes
Toggle to store the path or not
Toggle to store the Drive letter and path or not
Code block for File Progress
Returns:
.T. if file was create, otherwise .F.
Description:
This function creates a zip file named . If the extension
is omitted, .zip will be assumed. If the second parameter is a
character string, this file will be added to the zip file. If the
second parameter is an array, all file names contained in
will be compressed.
If is used, it determines the compression type where 0 means
no compression and 9 means best compression.
If is used, every time the file is opened to compress it
will evaluate bBlock. Parameters of bBlock are cFile and nPos.
If is used, it toggles to overwrite or not the existing
file. Default is to overwrite the file, otherwise if is
false the new files are added to the .
If is used, it tells thats the path should also be stored
with the file name. Default is false.
If is used, it tells thats the Drive and path should also
be stored with the file name. Default is false.
If is used, an Code block is evaluated, showing the total
of that file has being processed.
The codeblock must be defined as follow {| nPos, nTotal | GaugeUpdate( aGauge1, nPos / nTotal ) }
A code that tells if the current disk is the last of a
pkSpanned disk set.
Description:
This function tests if the disk inserted is the last disk of an backup
set or not.
It will return the follow return code when an error is found
Error code Meaning
114 Incorrect Disk
103 No Call back was set with hb_ZipTestPK()
Call this function to determine if the disk inserted is the correct
one before any other function.
Examples:
IF hb_ZipTestPK( "A:\test22.zip" ) == 114
? "Invalid Diskette"
ENDIF
Status:
R
Compliance:
This function is a Harbour extension
Files:
Library is hbziparc
See also:
HEADER()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Return the length of a database file header
Syntax:
HEADER() --> nBytes
Arguments:
Returns:
The numeric size of a database file header in bytes
Description:
This function returns the number of bytes in the header of the
selected database ot the database in the designated work area.
If used in conjunction with the LASTREC(), RECSIZE() and DISKSPACE()
functions, this functions is capable of implementing a backup and
restore routine.
Examples:
USE tests NEW
? Header()
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DISKSPACE(),LASTREC(),RECSIZE()
HEXATODEC()
Lang:
ht_conv.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_conv.txt
Template:
Category:
Conversion Tools
Subcategory:
Oneliner:
Converts a Hexa Value to Decimal
Syntax:
HEXATODEC() ->
Arguments:
NUMBER TO BE CONVERTED
Returns:
NUMBER CONVERTED
Description:
This function converts a string from an hexadecimal value
to a numeric decimal value.
Examples:
Status:
Compliance:
Files:
Library is libmisc
See also:
OctaltoDec(),BintoDec()
I2BIN()
Lang:
binnum.txt
Component:
harbour
Doc. source:
.\doc\en\binnum.txt
Template:
Function
Category:
API
Subcategory:
Conversion
Oneliner:
Convert Harbour numeric into signed short encoded bytes
Syntax:
I2BIN( ) --> cBuffer
Arguments:
is a numeric value to convert (decimal digits are ignored).
Returns:
I2BIN() return two bytes character string that contain 16 bit
encoded signed short integer (least significant byte first).
Description:
I2BIN() is one of the low level binary conversion functions, those
functions convert between Harbour numeric and a character
representation of numeric value. I2BIN() take a numeric integer
value and convert it into two bytes of encoded 16 bit signed short
integer.
You might ask what is the need for such functions, well, first of
all it allow you to read/write information from/to a binary file
(like extracting information from DBF header), it is also a useful
way to share information from source other than Harbour (C for
instance).
I2BIN() is the opposite of BIN2I()
Examples:
// Update DBF "last update" date
#include "fileio.ch"
PROCEDURE Main()
LOCAL nHandle, cYear, cMonth, cDay
USE test
? "Original update date is:", LUpdate()
CLOSE
nHandle := FOpen( "test.dbf", FO_READWRITE )
IF nHandle != F_ERROR
FSeek( nHandle, 1 )
cYear := I2Bin( 68 )
cMonth := I2Bin( 8 )
cDay := I2Bin( 1 )
FWrite( nHandle, cYear , 1 ) // write only the first byte
FWrite( nHandle, cMonth, 1 )
FWrite( nHandle, cDay , 1 )
FClose( nHandle )
USE test
? "New update date is:", lupdate()
CLOSE
ELSE
? "Can not open file"
ENDIF
RETURN
Returns the file extension of the index module used in an application
Syntax:
INDEXEXT() -->
Arguments:
None.
Returns:
Current driver file extension
Description:
This function returns a string that tells what indexes are to be used
or will be created in the compiled application. The default value is
".ntx". This is controled by the particular database driver that is
linked with the application.
Examples:
IF INDEXEXT() == ".ntx"
? "Current driver being used is DBFNTX"
ENDIF
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
INDEXKEY(),INDEXORD()
INDEXKEY()
Lang:
rddord.txt
Component:
harbour
Doc. source:
.\doc\en\rddord.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Yields the key expression of a specified index file.
Syntax:
INDEXKEY() -->
Arguments:
Index order number
Returns:
The index key
Description:
This function returns a character string stored in the header of the
index file
The index key is displayed for an index file that is designated by
, its position in the USE...INDEX or SET INDEX TO command in
the currently selected or designated work area. If there is no
corresnponding index key at the specified order position, a NULL
byte will be returned.
Examples:
USE tests NEW INDEX test1
? INDEXKEY( 1 )
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
INDEXORD()
INDEXORD()
Lang:
rddord.txt
Component:
harbour
Doc. source:
.\doc\en\rddord.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Returns the numeric position of the controlling index.
Syntax:
INDEXORD() -->
Arguments:
None.
Returns:
Ordinal position of a controling index
Description:
The INDEXORD() function returns the numeric position of the current
controlling index in the selected or designated work area.
A returned value of 0 indicated that no active index is controlling
the database,which therefore is in the natural order.
Examples:
USE tests NEW INDEX test1
IF INDEXORD() > 0
? "Current order is", INDEXORD()
ENDIF
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
INDEXKEY()
INFINITY()
Lang:
num1.txt
Component:
hbct
Doc. source:
hbct\doc\en\num1.txt
Template:
Category:
CT3 numeric functions
Subcategory:
Oneliner:
Returns the largest floating point number available in the system
Syntax:
INFINITY ([]) --> nLargestNumber
Arguments:
[] .T., if the function should return
the maximum floating point value
available (DBL_MAX)
.F., function should try to return
the same value as the original CT3 lib did
Default: .F.
Returns:
the largest floating point number available in the system
Description:
INFINITY() returns the largest floating point number available
in the system. For platform independance, this is set to DBL_MAX.
Examples:
Status:
Ready
Compliance:
INFINITY() must not necessarily return the same number as CT3's INFINITY().
Files:
Source is num1.c, library is libct.
See also:
INKEY()
Lang:
input.txt
Component:
harbour
Doc. source:
.\doc\en\input.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Extracts the next key code from the Harbour keyboard buffer.
Syntax:
INKEY( [] [,] ) --> nKey
Arguments:
is an optional timeout value in seconds, with a granularity
of 1/10th of a second. If omitted, INKEY() returns immediately. If set
to 0, INKEY() waits until an input event occurs. If set to any other
value, INKEY() will return either when an input event occurs or when
the timeout period has elapsed. If only this parameter is specified
and it is not numeric, it will be treated as if it were 0. But if both
parameters are specified and this parameter is not numeric, it will be
treated as if it were not present.
is an optional mask of input events that are to be enabled.
If omitted, defaults to hb_set.HB_SET_EVENTMASK. Valid input masks are
in inkey.ch and are explained below. It is recommended that the mask
names be used rather than their numeric values, in case the numeric
values change in future releases of Harbour. To allow more than one
type of input event, simply add the various mask names together.
inkey.ch Meaning
INKEY_MOVE Mouse motion events are allowed
INKEY_LDOWN The mouse left click down event is allowed
INKEY_LUP The mouse left click up event is allowed
INKEY_RDOWN The mouse right click down event is allowed
INKEY_RUP The mouse right click up event is allowed
INKEY_KEYBOARD All keyboard events are allowed
INKEY_ALL All mouse and keyboard events are allowed
HB_INKEY_EXTENDED Extended keyboard codes are used.
If the parameter is not numeric, it will be treated as if it were set
to hb_set.HB_SET_EVENTMASK.
Returns:
0 in case of timeout with no input event, otherwise returns a value
in the range -47 to 386 for keyboard events or the range 1001 to 1007
for mouse events. Mouse events and non-printable keyboard events are
represented by the K_ values listed in inkey.ch. Keyboard
event return codes in the range 32 through 127 are equivalent to the
printable ASCII character set. Keyboard event return codes in the
range 128 through 255 are assumed to be printable, but results may
vary based on hardware and nationality. If HB_INKEY_EXTENDED mode is
used, then the return value for keyboard events ranges from 1 through
767 and 1077 through 1491, although not all codes are used.
Extended key codes consist of the PC keyboard scan code and one
or more offset values. If no keyboard modifier was used, then
HB_INKEY_NONE is added. The Alt key adds HB_INKEY_ALT, the Ctrl
key adds HB_INKEY_CTRL, the Shift key adds HB_INKEY_SHIFT, and
enhanced keys (KeyPad+/ and CursorPad keys) add HB_INKEY_ENHANCED.
For example, F1 is scan code 59, so if you just press F1, you get
key code 315, but Alt+F1 gives 443, Ctrl+F1 gives 571, and Shift+
F1 gives 699. And NumPad+/ gives 1077, 1205, 1333, and 1461. At
this time, the only value that can combine with other values is
HB_INKEY_ENHANCED (i.e., there are no Alt+Ctl combinations, etc.)
Note: The extended key code set is larger than the normal key code
set. As a result, if you switch between the normal and extended
modes, you need to be aware that some codes get translated into a
zero in normal mode (because there is no corresponding code in
normal mode) and that these codes get removed from the keyboard
input buffer in normal mode and you won't be able to go back and
fetch them later in extended mode.
Description:
INKEY() can be used to detect input events, such as keypress, mouse
movement, or mouse key clicks (up and/or down).
Examples:
// Wait for the user to press the Esc key
? "Please press the ESC key."
DO WHILE Inkey( 0.1 ) != K_ESC
ENDDO
Status:
S
Compliance:
INKEY() is compliant with the CA-Cl*pper 5.3 INKEY() function with one
exception: The Harbour INKEY() function will raise an argument error
if the first parameter is less than or equal to 0 and the second
parameter (or the default mask) is not valid, because otherwise INKEY
would never return, because it was, in effect, asked to wait forever
for no events (Note: In CA-Cl*pper, this also blocks SET KEY events).
Files:
Library is rtl
See also:
inkey.ch
INT()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
API
Subcategory:
Math
Oneliner:
Return the integer port of a numeric value.
Syntax:
INT( ) -->
Arguments:
Any numeric value.
Returns:
The integer portion of the numeric value.
Description:
This function converts a numeric expression to an integer. All
decimal digits are truncated. This function does not round a value
upward or downward; it merely truncates a number at the decimal
point.
Examples:
SET DECIMAL TO 5
? INT( 632512.62541 )
? INT( 845414111.91440 )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ROUND(),STRZERO()
INVERTATTR()
Lang:
color.txt
Component:
hbct
Doc. source:
hbct\doc\en\color.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Syntax:
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
INVERTATTR() is compatible with CT3's INVERTATTR().
Files:
Source is color.c, library is libct.
See also:
INVERTWIN()
Lang:
screen1.txt
Component:
hbct
Doc. source:
hbct\doc\en\screen1.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Syntax:
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
INVERTWIN() is compatible with CT3's INVERTWIN().
Files:
Source is color.c, library is libct.
See also:
ISAFFIRM()
Lang:
nation.txt
Component:
harbour
Doc. source:
.\doc\en\nation.txt
Template:
Function
Category:
API
Subcategory:
Language and Nation
Oneliner:
Checks if passed char is an affirmation char
Syntax:
ISAFFIRM( ) -->
Arguments:
is a char or string of chars
Returns:
True if passed char is an affirmation char, otherwise
false
Description:
This function is used to check if a user's input is true or not
according to the msgxxx module used.
Examples:
// Wait until user enters Y
DO WHILE ! ISAFFIRM( cYesNo )
ACCEPT "Sure: " TO cYesNo
ENDDO
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ISNEGATIVE(),NATIONMSG()
ISALPHA()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Checks if leftmost character in a string is an alphabetic character
Syntax:
ISALPHA( ) --> lAlpha
Arguments:
Any character string
Returns:
lAlpha Logical true (.T.) or false (.F.).
Description:
This function return a logical true (.T.) if the first character
in is an alphabetic character. If not, the function will
return a logical false (.F.).
C Prototype (macro definition)
#include "hbapi.h"
ISARRAY( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISBIN()
Lang:
ht_conv.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_conv.txt
Template:
Category:
Conversion Tools
Subcategory:
Oneliner:
Check if the value is a Binary Number
Syntax:
ISBIN() ->
Arguments:
STRING TO BE CHECKED
Returns:
.T. IF THE STRING IS BYNARY,otherwise .F.
Description:
check if the passed string is a bynary number or not
Examples:
Status:
Compliance:
Files:
Library is libmisc
See also:
ISOCTAL(),ISDEC(),ISHEXA()
ISBLOCK()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Not available in CA-Cl*pper.
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
ISBLOCK( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISBYREF()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
NOTE: Intentionally using a different method
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
ISBYREF( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISCHAR()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
ISCHAR( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISDATE()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
ISDATE( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISDEC()
Lang:
ht_conv.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_conv.txt
Template:
Category:
Conversion Tools
Subcategory:
Oneliner:
Check if the value is a Decimal Number
Syntax:
ISDEC() ->
Arguments:
STRING TO BE CHECKED
Returns:
.T. IF THE STRING IS DECIMAL;otherwise .F.
Description:
check if the passed string is a decimal number or not
Examples:
Status:
Compliance:
Files:
Library is libmisc
See also:
ISOCTAL(),ISBIN(),ISHEXA()
ISDIGIT()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Checks if leftmost character is a digit character
Syntax:
ISDIGIT( ) --> lDigit
Arguments:
Any character string
Returns:
lDigit Logical true (.T.) or false (.F.).
Description:
This function takes the character string and checks to
see if the leftmost character is a digit, from 1 to 9. If so, the
function will return a logical true (.T.); otherwise, it will
return a logical false (.F.).
This function attempts to access a drive. If the access to the drive
was successfull, it will return true (.T.), otherwise false(.F.). This
function is usefull for backup function, so you can determine if the
drive that will receive the backup data is ready or not.
C Prototype (macro definition)
#include "hbapi.h"
ISLOG( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISLOWER()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Checks if leftmost character is an lowercased letter.
Syntax:
ISLOWER( ) --> lLower
Arguments:
Any character string
Returns:
lLower Logical true (.T.) or false (.F.).
Description:
This function takes the character string and checks to
see if the leftmost character is a lowercased letter. If so, the
function will return a logical true (.T.); otherwise, it will
return a logical false (.F.).
C Prototype (macro definition)
#include "hbapi.h"
ISMEMO( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISNEGATIVE()
Lang:
nation.txt
Component:
harbour
Doc. source:
.\doc\en\nation.txt
Template:
Function
Category:
API
Subcategory:
Language and Nation
Oneliner:
Checks if passed char is a negation char.
Syntax:
ISNEGATIVE( ) -->
Arguments:
is a char or string of chars
Returns:
True if passed char is a negation char, otherwise
false.
Description:
This function is used to check if a user's input is true or not
according to the msgxxx module used.
Examples:
// Wait until user enters N
DO WHILE ! ISNEGATIVE( cYesNo )
ACCEPT "Sure: " TO cYesNo
ENDDO
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ISAFFIRM(),NATIONMSG()
ISNIL()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
NOTE: Intentionally using a different method
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
ISNIL( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISNUM()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
ISNUM( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISOBJECT()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
ISOBJECT( n ) --> asArray.value->uiClass != 0 )>
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISOCTAL()
Lang:
ht_conv.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_conv.txt
Template:
Category:
Conversion Tools
Subcategory:
Oneliner:
Check if the value is a Octal Number
Syntax:
ISOCTAL() ->
Arguments:
STRING TO BE CHECKED
Returns:
.T. IF THE STRING IS OCTAL;otherwise .F.
Description:
check if the passed string is a octal number or not
Examples:
Status:
Compliance:
Files:
Library is libmisc
See also:
ISBIN(),ISDEC(),ISHEXA()
ISPOINTER()
Lang:
hb_api.txt
Component:
harbour
Doc. source:
.\doc\en\hb_api.txt
Template:
Function
Category:
C level API
Subcategory:
Extend
Oneliner:
Not available in CA-Cl*pper.
Syntax:
C Prototype (macro definition)
#include "hbapi.h"
ISPOINTER( n ) -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapi.h
See also:
ISUPPER()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Checks if leftmost character is an uppercased letter.
Syntax:
ISUPPER( ) --> lUpper
Arguments:
Any character string
Returns:
lUpper Logical true (.T.) or false (.F.).
Description:
This function checks to see if the leftmost character
if is a uppercased letter. If so, the
function will return a logical true (.T.); otherwise, it will
return a logical false (.F.).
Move characters from the beginning to the end of a string
Syntax:
JUSTLEFT (<[@]cString>, [|]) -> cJustifiedString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
JUSTLEFT() is compatible with CT3's JUSTLEFT().
Files:
Source is justify.c, library is libct.
See also:
JUSTRIGHT()
JUSTRIGHT()
Lang:
justify.txt
Component:
hbct
Doc. source:
hbct\doc\en\justify.txt
Template:
Category:
Harbour Tools string functions
Subcategory:
Oneliner:
Move characters from the end to the beginning of a string
Syntax:
JUSTRIGHT (<[@]cString>, [|]) -> cJustifiedString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
JUSTRIGHT() is compatible with CT3's JUSTRIGHT().
Files:
Source is justify.c, library is libct.
See also:
JUSTLEFT()
KEYBOARD
Lang:
input.txt
Component:
harbour
Doc. source:
.\doc\en\input.txt
Template:
Command
Category:
Command
Subcategory:
User interface
Oneliner:
Stuffs the keyboard with a string.
Syntax:
KEYBOARD
Arguments:
String to be processed, one character at a time,
by the Harbour keyboard processor
Returns:
Description:
This command stuffs the input buffer with .
The number of characters that can be stuffed into the keyboard
buffer is controlled by the SET TYPEAHEAD command and may range
from 0 to 32,622, with each character being in the ASCII
range of 0 to 255.
None of the extended keys may be stuffed into the keyboard buffer.
Issuing a KEYBOARD " " will clear the keyboard buffer.
Examples:
// Stuff an Enter key into the keyboard buffer
KEYBOARD CHR(13)
// Clear the keyboard buffer
CLEAR TYPEAHEAD
Status:
R
Compliance:
KEYBOARD is compliant with CA-Cl*pper 5.3
Files:
See also:
CLEAR TYPEAHEAD,__KEYBOARD()
KSETCAPS()
Lang:
keyset.txt
Component:
hbct
Doc. source:
hbct\doc\en\keyset.txt
Template:
Category:
CT3 switch and state functions
Subcategory:
Oneliner:
Syntax:
KSETCAPS ([]) -> lOldSwitch
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is keyset.c, library is libct.
See also:
KSETINS()
Lang:
keyset.txt
Component:
hbct
Doc. source:
hbct\doc\en\keyset.txt
Template:
Category:
CT3 switch and state functions
Subcategory:
Oneliner:
Syntax:
KSETINS ([]) -> lOldSwitch
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is keyset.c, library is libct.
See also:
KSETNUM()
Lang:
keyset.txt
Component:
hbct
Doc. source:
hbct\doc\en\keyset.txt
Template:
Category:
CT3 switch and state functions
Subcategory:
Oneliner:
Syntax:
KSETNUM ([]) -> lOldSwitch
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is keyset.c, library is libct.
See also:
KSETSCROLL()
Lang:
keyset.txt
Component:
hbct
Doc. source:
hbct\doc\en\keyset.txt
Template:
Category:
CT3 switch and state functions
Subcategory:
Oneliner:
Syntax:
KSETSCROLL ([]) -> lOldSwitch
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is keyset.c, library is libct.
See also:
L2BIN()
Lang:
binnum.txt
Component:
harbour
Doc. source:
.\doc\en\binnum.txt
Template:
Function
Category:
API
Subcategory:
Conversion
Oneliner:
Convert Harbour numeric into signed long encoded bytes
Syntax:
L2BIN( ) --> cBuffer
Arguments:
is a numeric value to convert (decimal digits are ignored).
Returns:
L2BIN() return four bytes character string that contain 32 bit
encoded signed long integer (least significant byte first).
Description:
L2BIN() is one of the low level binary conversion functions, those
functions convert between Harbour numeric and a character
representation of numeric value. L2BIN() take a numeric integer
value and convert it into four bytes of encoded 32 bit signed long
integer.
You might ask what is the need for such functions, well, first of
all it allow you to read/write information from/to a binary file
(like extracting information from DBF header), it is also a useful
way to share information from source other than Harbour (C for
instance).
L2BIN() is the opposite of BIN2L()
Name of label file
Name of an alternate file
Expression of a scoping condition
WHILE condition
FOR condition
Returns:
Description:
This command allows labels to be printed based on the format
outlined in LBL file specified as . By default, output
will go to the screen however this output may be rerouted with
either the TO PRINTER or the TO FILE clause.
If the TO FILE clause is specified, the name of the ASCII text file
containing the generated labels will be .
If no file extension is specified a .txt extension is added.
is the scope condition for this command. Valid scopes
include NEXT (number of records to be displayed, where
is the number of records), RECORD (a specific record to be
printed), REST (all records starting from the current record
position,and ALL (all records). The default is ALL.
Both logical expression may work ill conjunction with one another
where is the logical expression for the FOR condition (for
records to be displayed whitin a given value range) and for
the WHILE condition (for records to be displayed until they fail to
meet the condition).
If the SAMPLE clause is specified, test labels will be generated.
If the NOCONSOLE clause is specified,the console will be turned off
while this command is being executed.
This command follows the search criteria outlined in the SET PATH TO
command. The path may be specified, along, with (the drive letter,
in
Examples:
PROCEDURE Main()
USE test NEW
LABEL FORM EE
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
REPORT FORM
Language and Nation MSG()
Lang:
nation.txt
Component:
harbour
Doc. source:
.\doc\en\nation.txt
Template:
Function
Category:
API
Subcategory:
Language and Nation
Oneliner:
Returns international strings messages.
Syntax:
Language and Nation MSG( ) -->
Arguments:
is the message number you want to get.
Returns:
If is a valid message selector, returns the message.
If is nil returns "Invalid Argument", and if is any
other type it returns an empty string.
Description:
Language and Nation MSG() returns international message descriptions.
Examples:
// Displays "Sure Y/N: " and waits until user enters Y
// Y/N is the string for NATIONMSG( 12 ) with default natmsg module.
DO WHILE ! ISAFFIRM( cYesNo )
ACCEPT "Sure " + NATIONMSG( 12 ) + ": " TO cYesNo
ENDDO
Status:
C
Compliance:
C
Files:
Library is rtl
See also:
ISAFFIRM(),ISNEGATIVE()
LASTDAYOM()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
Returns the the number of days in the month.
Syntax:
LASTDAYOM ([]) -> nDaysInMonth
Arguments:
Returns:
Description:
can be a date or a month number. If empty uses the
system date. If nMonth is a 2, lastdayom() will not know if it
is a leap year or not. If dDate is invalid, returns 0
TODO: add further documentation
Examples:
Status:
Started
Compliance:
LASTDAYOM() is compatible with CT3's LASTDAYOM().
Files:
Source is dattime2.prg, library is libct.
See also:
EOM()
LASTKEY()
Lang:
input.txt
Component:
harbour
Doc. source:
.\doc\en\input.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Get the last key extracted from the keyboard buffer.
Syntax:
LASTKEY( [] ) --> nKey
Arguments:
nInputMask is an optional integer value composed of one or more
INKEY_ or HB_INKEY_ constants. The sole purpose of this argument
is to allow switching between using HB_INKEY_EXTENDED key codes
and using the normal CA-Cl*pper-compatible key codes
Returns:
The last key extracted from the keyboard buffer.
Description:
Returns the value of the last key exttracted from the Harbour
keyboard buffer
Examples:
// Continue looping unless the ESC key was pressed in MainFunc()
DO WHILE .T.
MainFunc()
IF LastKey() == K_ESC
EXIT
ENDIF
ENDDO
Status:
R
Compliance:
LASTKEY() is compliant with CA-Cl*pper 5.3, but has been extended
for Harbour.
Files:
Library is rtl
See also:
INKEY(),LASTKEY()
LASTREC()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Returns the number of records in an active work area or database.
Syntax:
LASTREC() | RECCOUNT()* --> nRecords
Arguments:
Returns:
The number of records
Description:
This function returns the number of records present in the database
in the selected or designated work area. If no records are present
the value of this function will be 0. Additionaly, if no database is
in use in the selected or designated work area, this function will
return a 0 value as well.
Examples:
USE tests NEW
? LASTREC(), RECCOUNT()
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
EOF()
LEFT()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Extract the leftmost substring of a character expression
Syntax:
LEFT( , ) --> cReturn
Arguments:
Main character to be parsed
Number of bytes to return beginning at the leftmost position
Returns:
Substring of evaluation
Description:
This functions returns the leftmost characters of .
It is equivalent to the following expression:
SUBSTR( , 1, )
Examples:
? LEFT( "HELLO HARBOUR", 5 ) // HELLO
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
SUBSTR(),RIGHT(),AT(),RAT()
LEN()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
Returns size of a string or size of an array.
Syntax:
LEN( | ) -->
Arguments:
is a character string or the array to check.
Returns:
The length of the string or the number of elements that contains
an array.
Description:
This function returns the string length or the size of an array or the
size of a hash table. If it is used with a multidimensional array it
returns the size of the first dimension.
Name of a memory variable or array.
Value to be assinged to a variable or array
Returns:
Description:
This command created a LOCAL memory variable or array. The name
of either is specified in . If more then one variable is being
initialized with the LOCAL command,separate each entry with a comma.
If a variable or an array is to be assingned a start-up value,that
expression may be specified in and folling. Is Strong type
compile mode is used, the Compiler will check if the value recived
matchs the type specified in .
LOCAL varibles are symbols generated at run time and are resolved
at compile time. The visibility and life span of a LOCAL variable or
array is limited to the function or procedure in which it is defined.
No macro expansions are allowed in the LOCAL declaration statement.
No Harbour command other then FUNCTION, PROCEDURE, PUBLIC, PRIVATE,
PARAMETERS, MEMVAR, STATIC and FIELD, may precede the LOCAL command.
LOCAL array reference may not be initialized (i.e., assigned values)
on the same command line as the LOCAL command statement. This can be
done later in the program.
LOCAL variables and arrays are not affected by the RELEASE command.
Examples:
PROCEDURE Main()
LOCAL n, lVar
n := iif( lVar, "A", 3 )
n := 2
n := "a"
n := seconds() + 2
n := int( seconds() + 2 )
RETURN
Status:
R
Compliance:
C
Files:
None
See also:
FIELD,PRIVATE,PUBLIC,STATIC,MEMVAR
LOG()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
API
Subcategory:
Math
Oneliner:
Returns the natural logarithm of a number.
Syntax:
LOG( ) -->
Arguments:
Any numeric expression.
Returns:
The natural logarithm of .
Description:
This function returns the natural logarithm of the number .
If is 0 or less than 0, a numeric overflow occurs,
which is depicted on the display device as a series of asterisks.
This function is the inverse of EXP().
Examples:
? LOG( 632512 )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
EXP()
LOG10()
Lang:
ctmath2.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctmath2.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Decadic logarithm of a number
Syntax:
LOG10 (nNumber) -> nLogarithm
Arguments:
number to logarithm
Returns:
decadic logarithm of
Description:
The function LOG10() calculates the decadic logarithm of ,
i.e. 10^ == .
Universally lowercases a character string expression.
Syntax:
LOWER( ) --> cLowerString
Arguments:
Any character expression.
Returns:
Lowercased value of
Description:
This function converts any character expression passes as
to its lowercased representation. Any non alphabetic character withing
will remain unchanged.
LTRIM() returns a copy of the original string with leading spaces
removed.
Description:
This function trims the leading space blank
Examples:
? LTRIM( "HELLO " )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
TRIM(),RTRIM(),ALLTRIM()
LUPDATE()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Yields the date the database was last updated.
Syntax:
LUPDATE() --> dModification
Arguments:
(This function has no arguments)
Returns:
The date of the last modification.
Description:
This function returns the date recorded by the OS when the selected
or designated database was last written to disk. This function will
only work for those database files in USE.
Examples:
PROCEDURE Main()
USE tests NEW
? LUpdate()
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
FIELDNAME(),LASTREC(),RECSIZE()
Macro compiler
Lang:
macro.txt
Component:
harbour
Doc. source:
.\doc\en\macro.txt
Template:
Document
Category:
Document
Subcategory:
Compiler
Oneliner:
Macro compiler
Syntax:
Arguments:
Returns:
Description:
Invoking the macro compiler:
==============================
&variable
or
&( expression )
or
&variable.text
Examples:
Status:
Compliance:
Files:
See also:
MAKEDIR()
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Function
Category:
API
Subcategory:
FileSys
Oneliner:
Create a new directory
Syntax:
MAKEDIR( ) --> nError
Arguments:
The name of the directory you want to create.
Returns:
0 if directory was successfully created, otherwise
the number of the last error.
Description:
This function attempt to create a new directory with the name contained
in . If this function fails, it will return the last OS
error code number. See FERROR() function for the description of the
error
This function supplements EXPONENT() to return the mantissa of the
number.
Note: The mantissa value can be 0 or in the range of 1 to 2.
The following calculation reproduces the original value:
MANTISSA()* 2^EXPONENT() =
TODO: add documentation
Examples:
Status:
Started
Compliance:
MANTISSA() is compatible with CT3's MANTISSA().
Files:
Source is exponent.c, library is libct.
See also:
EXPONENT()
MAX()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
API
Subcategory:
Math
Oneliner:
Returns the maximum of two numbers or dates.
Syntax:
MAX( , ) -->
Arguments:
Any date or numeric value.
Any date or numeric value (same type as ).
Returns:
The larger numeric (or later date) value.
Description:
This function returns the larger of the two passed espressions. If
and are numeric data types, the value returned by
this function will be a numeric data type as well and will be the
larger of the two numbers passed to it. If and
are date data types, the return value will be a date data type as
well. It will be the later of the two dates passed to it.
Returns the maximun number of columns in the current video mode
Syntax:
MAXCOL() --> nPosition
Arguments:
None.
Returns:
The maximun number of columns possible in current video
mode
Description:
This function returns the current cursor column position. The value
for this function can range between 0 and MAXCOL().
Examples:
? MAXCol()
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ROW(),MAXROW(),COL()
MAXROW()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Function
Category:
API
Subcategory:
Terminal
Oneliner:
Returns the current screen row position
Syntax:
MAXROW() --> nPosition
Arguments:
None.
Returns:
The maximun number of rows possible in current video
mode
Description:
This function returns the current cursor row location. The value
for this function can range between 0 and MAXCOL().
Examples:
? MAXROW()
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
COL(),ROW(),MAXCOL()
MCOL()
Lang:
input.txt
Component:
harbour
Doc. source:
.\doc\en\input.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Returns the mouse cursor column position.
Syntax:
MCol() --> nMouseColumn
Arguments:
None
Returns:
The mouse cursor column position.
Description:
This function returns the column position of the mouse cursor.
On graphical systems the value represents pixels.
On character-based systems the value represents character
columns as in CA-Cl*pper.
Examples:
IF MCol() < 1
? "Mouse is on left edge!"
ENDIF
Status:
R
Compliance:
MCOL() is compliant with CA-Cl*pper 5.3, but has been extended
to work on graphical systems as well as character-based systems.
Files:
Library is rtl
See also:
MROW()
MD()
Lang:
ht_file.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_file.txt
Template:
Category:
Dos Tools
Subcategory:
Oneliner:
Creates a Directory
Syntax:
MD() ->
Arguments:
DIRECTORY TO BE CREATED
Returns:
.T. IF SUCESSFUL; otherwise .F.
Description:
CREATE A DIRECTORY
Examples:
IF MD("OLA")
RETURN .T.
ELSE
RETURN .F.
ENDIF
Status:
Compliance:
Files:
Header is Fileio.ch
See also:
CD(),MD()
MDY()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
Returns the date as a string in Month DD, YY or Month DD, YYYY
Syntax:
MDY ([]) -> cDateString
Arguments:
Returns:
Description:
Returns the date as a string in Month DD, YY or Month DD, YYYY
If dDate is NULL, the system date is used
TODO: add further documentation
Examples:
Status:
Started
Compliance:
MDY() is compatible with CT3's MDY().
Files:
Source is dattime2.prg, library is libct.
See also:
DMY()
MEMOREAD()
Lang:
memo.txt
Component:
harbour
Doc. source:
.\doc\en\memo.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Return the text file's contents as a character string
Syntax:
MEMOREAD( ) --> cString
Arguments:
is the filename to read from disk.
It must include the file extension. If file to be read
lives in another directory, you must include the path.
Returns:
Returns the contents of a text file as a character string.
If cannot be found or read MEMOREAD returns an empty
string ("").
Description:
MEMOREAD() is a function that reads the content of a text file (till
now) from disk (floppy, HD, CD-ROM, etc.) into a memory string.
In that way you can manipulate as any character string or assigned
to a memo field to be saved in a database.
MEMOREAD() function is used together with MEMOEDIT() and MEMOWRIT()
to get from disk text from several sources that would be edited,
searched, replaced, displayed, etc.
It is used to import data from other sources to our database.
Note:
MEMOREAD() does not use the settings SET DEFAULT or SET PATH to
search for .
It searches for in the current directory.
If the file is not found, then MEMOREAD() searches in the DOS path.
Over a network, MEMOREAD() attempts to open in read-only
mode and shared. If the file is used in mode exclusive by another
process, the function will returns a null string ("").
Examples:
* This example uses MEMOREAD() to assign the contents of a text
file to a character variable for later search
cFile := "account.prg"
cString := MEMOREAD( cFile )
IF At( "Melina", cString ) == 0 // check for copyright
MEMOWRIT( cFile, cCopyright + cString ) // if not, add it!
ENDIF
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
MEMOEDIT(),MEMOWRIT(),REPLACE
MEMOTRAN()
Lang:
memo.txt
Component:
harbour
Doc. source:
.\doc\en\memo.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Converts hard and soft carriage returns within strings.
Syntax:
MEMOTRAN( , , ) -->
Arguments:
is a string of chars to convert.
is the character to replace hard returns with. If not
specified defaults to semicolon.
is the character to replace soft returns with. If not
specified defaults to single space.
Returns:
Trasformed string.
Description:
Returns a string/memo with carriage return chars converted to
specified chars.
Examples:
? MEMOTRAN( DATA->CNOTES )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
HARDCR(),STRTRAN()
MEMOWRIT()
Lang:
memo.txt
Component:
harbour
Doc. source:
.\doc\en\memo.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Write a memo field or character string to a text file on disk
Syntax:
MEMOWRIT( , , [] ) --> lSuccess
Arguments:
is the filename to read from disk.
It must include the file extension. If file to be read
lives in another directory, you must include the path.
Is the memo field or character string, to be write to
.
Is a logic variable that settle if the "end of file"
character - CHR(26) - is written to disk.
This parameter is optional. By default is true (.T.)
Returns:
Function returns true (.T.) if the writing operation was successful;
otherwise, it returns false (.F.).
Description:
This a function that writes a memo field or character string to a
text file on disk (floppy, HD, CD-ROM, etc.)
If you not specified a path, MEMOWRIT() writes to the
current directory. If exists, it is overwritten.
There is a third parameter (optional), , (not found in
CA-Cl*pper) which let to programmer change the default behavior of
- allways - to write the EOF character, CHR(26) as in CA-Cl*pper.
If there is no third parameter, nothing change, EOF is written as
in CA-Cl*pper, the same occurs when is set to .T.
But, if is set to .F., EOF char is Not written to the
end of the file.
MEMOWRIT() function is used together with MEMOREAD() and MEMOEDIT()
to save to disk text from several sources that was edited, searched,
replaced, displayed, etc.
Note that MEMOWRIT() do not use the directory settings SET DEFAULT.
Examples:
* This example uses MEMOWRIT() to write the contents of a character
variable to a text file.
cFile := "account.prg"
cString := MEMOREAD( cFile )
IF At( "Melina", cString ) == 0 // check for copyright
MEMOWRIT( cFile, cCopyright + cString ) // if not, add it!
ENDIF
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
MEMOEDIT(),MEMOREAD()
MEMVAR
Lang:
memvar2.txt
Component:
harbour
Doc. source:
.\doc\en\memvar2.txt
Template:
Command
Category:
Command
Subcategory:
Variable management
Oneliner:
Declares private and public variables and arrays.
Syntax:
MEMVAR
Arguments:
Memory variable Name
Returns:
Description:
This command tells the compiler to resolve any reference to a memory
variable designated within this list s if it possessed an explicit
memory variable alias with either the M-> or MEMVAR-> prefix.Only
those memory variables that do not contain any such explicit are
affected by this command. Those memory variabls within macro
expansions are not affected by this command.
The MEMVAR declaration must apear before any executable commands;it
is similat to the LOCAL,STATIC,FIELD,PARAMETERS,FUNCTION, and
PROCEDURE commands statements.
Examples:
MEMVAR y AS NUMERIC
PROCEDURE Main()
LOCAL n, lVar
n := iif( lVar, "A", 3 )
n := 2
n := "a"
n := seconds() + 2
n := int( seconds() + 2 )
y := n
? y
RETURN
Status:
R
Compliance:
C
Files:
None.
See also:
LOCAL,STATIC,FIELD,PRIVATE,PUBLIC
MEMVARBLOCK()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
Returns a codeblock that sets/gets a value of memvar variable
Syntax:
MEMVARBLOCK( ) -->
Arguments:
- a string that contains the name of variable
Returns:
a codeblock that sets/get the value of variable
Description:
This function returns a codeblock that sets/gets the value of
PRIVATE or PUBLIC variable. When this codeblock is evaluated
without any parameters passed then it returns the current value
of given variable. If the second parameter is passed for
the codeblock evaluation then its value is used to set the new
value of given variable - the passed value is also returned
as a value of the codeblock evaluation.
Examples:
PROCEDURE Main()
LOCAL cbSetGet
PUBLIC xPublic
cbSetGet := MEMVARBLOCK( "xPublic" )
EVAL( cbSetGet, "new value" )
? "Value of xPublic variable", EVAL( cbSetGet )
RETURN
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
__MVGET(),__MVPUT()
MENU TO
Lang:
menu.txt
Component:
harbour
Doc. source:
.\doc\en\menu.txt
Template:
Command
Category:
API
Subcategory:
User interface
Oneliner:
Invoked a menu defined by set of @...PROMPT
Syntax:
MENU TO
Arguments:
is a character string that contain the name of the
variable to hold the menu choices, if this variable does not exist
a PRIVATE variable with the name would be created to
hold the result.
Returns:
Description:
Menu To() invoked the menu define by previous __AtPrompt() call
and display a highlight bar that the user can move to select an
option from the menu. If does not exist or not visible,
a PRIVATE variable named is created and hold the current
menu selection. If there is a variable named , its value
is used to select the first highlighted item.
Menu prompts and messages are displayed in current Standard color,
highlighted bar is displayed using current Enhanced color.
Pressing the arrow keys move the highlighted bar. When a menu item
is highlighted the message associated with it is displayed on the
line specified with SET MESSAGE. If SET WRAP is ON and the user
press UP arrow while on the first selection the last menu item is
highlighted, if the user press Down arrow while on the last item,
the first item is highlighted.
Following are active keys that handled by Menu To:
key Meaning
Up - Move to previous item
Down - Move to next item
Left - Move to previous item
Right - Move to next item
Home - Move to the first item
End - Move to the last item
Page-Up - Select menu item, return position
Page-Down - Select menu item, return position
Enter - Select menu item, return position
Esc - Abort selection, return 0
First letter - Select next menu with the same first letter,
| return this item position.
upon exit the cursor is placed at MAXROW()-1, 0
Menu To can be nested without loosing the previous prompts.
MENU TO command is preprocessed into __MenuTo() function during
compile time.
Examples:
// display menu item on each screen corner and let user select one
CLS
SET MESSAGE TO MAXROW() / 2 CENTER
SET WRAP ON
@ 0 , 0 PROMPT "1. Upper left" MESSAGE " One "
@ 0 , MAXCOL() - 16 PROMPT "2. Upper right" MESSAGE " Two "
@ MAXROW() - 1, MAXCOL() - 16 PROMPT "3. Bottom right" MESSAGE "Three"
@ MAXROW() - 1, 0 PROMPT "4. Bottom left" MESSAGE "Four "
MENU TO nChoice
SETPOS( MAXROW() / 2, MAXCOL() / 2 - 10 )
IF nChoice == 0
?? "Esc was pressed"
ELSE
?? "Selected option is", nChoice
ENDIF
The pseudo-method name to define
The method to create and call when
is invoked.
Optional parameter list for the method
Returns:
Description:
The MESSAGE command is a seldom-used feature that lets you re-route
a call to a method with a different name. This can be necessary if
a method name conflicts with a public function that needs to be
called from within the class methods.
For example, your app may have a public function called BeginPaint()
that is used in painting windows. It would also be natural to have a
Window class method called :BeginPaint() that the application can
call. But within the class method you would not be able to call the
public function because internally methods are based on static
functions (which hide public functions of the same name).
The MESSAGE command lets you create the true method with a different
name (::xBeginPaint()), yet still allow the ::BeginPaint() syntax
to call ::xBeginPaint(). This is then free to call the public
function BeginPaint().
Examples:
CREATE CLASS TWindow
VAR hWnd, nOldProc
METHOD New( ) CONSTRUCTOR
MESSAGE BeginPaint METHOD xBeginPaint()
ENDCLASS
Name of the method to define
Optional parameter list
Returns:
Description:
Methods are "class functions" which do the work of the class.
All methods must be defined in the class header between the
CLASS and ENDCLASS commands. If the body of a method is not fully
defined here, the full body is written below the ENDCLASS command
using this syntax:
METHOD ( [] ) CLASS
Methods can reference the current object with the keyword "Self:" or
its shorthand version "::".
CLAUSES:
CONSTRUCTOR Defines a special method Class Constructor method,
used to create objects. This is usually the
New() method. Constructors always return the new
object.
INLINE Fast and easy to code, INLINE lets you define the
code for the method immediately within the definition
of the Class. Any methods not declared INLINE or BLOCK
must be fully defined after the ENDCLASS command.
The following INLINE receives a parameter
of Self. If you need to receive more parameters, use
the BLOCK clause instead.
BLOCK Use this clause when you want to declare fast 'inline'
methods that need parameters. The first parameter to
must be Self, as in:
METHOD BLOCK {|Self,,, ...,|...}
EXTERN If an external function does what the method needs,
use this clause to make an optimized call to that
function directly.
SETGET For calculated Data. The name of the method can be
manipulated like a Data element to Set or Get a value.
VIRTUAL Methods that do nothing. Useful for Base classes where
the child class will define the method's behavior, or
when you are first creating and testing a Class.
OPERATOR Operator Overloading for classes.
See example Tests/TestOp.prg for details.
CLASS
Use this syntax only for defining a full method after
the ENDCLASS command.
Any date or numeric value.
Any date or numeric value.
Returns:
The smaller numeric (or earlier date) value.
Description:
This function returns the smaller of the two passed espressions.
and must be the same data type. If numeric, the
smaller number is returned. If dates, the earlier date is returned.
Corresponding number of the month in the year, ranging from
0 to 12
Description:
This function returns a number that represents the month of a given
date expression . If a NULL date (CTOD('')) is passed to the
function, the value of the function will be 0.
Examples:
? Month( Date() )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
CDOW(),DOW(),YEAR(),CMONTH()
MROW()
Lang:
input.txt
Component:
harbour
Doc. source:
.\doc\en\input.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Returns the mouse cursor row position.
Syntax:
MRow() --> nMouseRow
Arguments:
None
Returns:
The mouse cursor row position.
Description:
This function returns the current mouse row cursor position.
On graphical systems the value represents pixel rows.
On character-based systems the value represents character
rows as in CA-Cl*pper.
Examples:
IF MRow() < 1
? "Mouse is on top row!"
ENDIF
Status:
R
Compliance:
MROW() is compliant with CA-Cl*pper 5.3, but has been extended
to work on graphical systems as well as character-based systems.
Files:
Library is rtl
See also:
MCOL()
NETERR()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Tests the success of a network function
Syntax:
NETERR([]) --> lError
Arguments:
Is a logical Expression.
Returns:
A value based on the success of a network operation or
function.
Description:
This function return a logical true (.T.) is a USE, APPEND BLANK, or
a USE...EXCLUSIVE command is issue and fails in a network enviroment.
In the case of USE and USE...EXCLUSIVE commands, a NETERR() value
of .T. would be returned if another node of the network has the
exclusive use of a file. And the case of the APPEND BLANK command,
NETERR() will return a logical true (.T.) if the file or record
is locked by another node or the value of LASTREC() has been advanced
The value of NETERR() may be changed via the value of .
This allow the run-time error-handling system to control the way
certains errors are handled.
Examples:
USE test NEW INDEX test
IF ! NetErr()
SEEK test->Name := "HARBOUR"
IF Found()
? test->Name
ENDIF
ENDIF
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
FLOCK(),RLOCK()
NEXTKEY()
Lang:
input.txt
Component:
harbour
Doc. source:
.\doc\en\input.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Get the next key code in the buffer without extracting it.
Syntax:
NEXTKEY( [] ) --> nKey
Arguments:
nInputMask is an optional integer value composed of one or more
INKEY_ or HB_INKEY_ constants. The sole purpose of this argument
is to allow switching between using HB_INKEY_EXTENDED key codes
and using the normal CA-Cl*pper-compatible key codes
Returns:
The value of the next key in the Harbour keyboard buffer.
Description:
Returns the value of the next key in the Harbour keyboard buffer
without extracting it.
Examples:
// Use NEXTKEY() with INKEY() to change display characters, or by
// itself to exit the loop, so that the caller can detect the Esc.
LOCAL nKey, cChar := "+"
DO WHILE .T.
?? cChar
nKey := NextKey()
IF nKey == K_ESC
EXIT
ELSE
IF nKey != 0
cChar := Chr( nKey )
ENDIF
ENDIF
ENDDO
Status:
R
Compliance:
NEXTKEY() is compliant with CA-Cl*pper 5.3, but has been extended
for Harbour.
Files:
Library is rtl
See also:
INKEY(),LASTKEY()
NTOC()
Lang:
numconv.txt
Component:
hbct
Doc. source:
hbct\doc\en\numconv.txt
Template:
Category:
CT3 number and bit manipulation functions
Subcategory:
Oneliner:
Syntax:
NTOC ([, ][,][,]) ->
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is numconv.prg, library is libct.
See also:
CTON()
NTOCDOW()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
(num of day) -> day name
Syntax:
NTOCDOW () -> cDay
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
NTOCDOW() is compatible with CT3's NTOCDOW().
Files:
Source is dattime2.prg, library is libct.
See also:
CTODOW()
NTOCMONTH()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
(num of month ) -> Month Name
Syntax:
NTOCMONTH () -> cMonth
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
NTOCMONTH() is compatible with CT3's NTOCMONTH().
Files:
Source is dattime2.prg, library is libct.
See also:
CTOMONTH()
NTOCOLOR()
Lang:
color.txt
Component:
hbct
Doc. source:
hbct\doc\en\color.txt
Template:
Category:
HBCT video functions
Subcategory:
Oneliner:
Syntax:
NTOCOLOR ( , [] ) ->
Arguments:
Designates the value for the combined numeric color
attributes.
If designated as .F. or if the parameter is omitted,
NTOCOLOR() returns a string with a numeric color code.
When designated as .T., NTOCOLOR() returns a string with
the CA-Cl*pper alpha color coding.
Returns:
NTOCOLOR() returns the designated color attribute in the NN/NN
or CC/CC form.
Description:
NTOCOLOR() converts a color attribute returned from another function
in numeric form, into the alphanumeric data format. Use this
attribute in conjunction with the CA-Cl*pper SET COLOR TO command.
TODO: add documentation
This function return th character name of the RDD extension for
the order bag. This is determined by the active RDD for the selected
work area.
This function replaces the Indexord() function.
Examples:
USE tests NEW VIA "DBFNTX"
? ORDBAGEXT() // Returns .ntx
DBCLOSEAREA()
USE tests NEW VIA "DBFCDX"
? ORDBAGEXT() // Returns .cdx
DBCLOSEAREA()
Status:
S
Compliance:
C
Files:
Library is rdd
See also:
INDEXEXT(),ORDBAGNAME()
ORDBAGNAME()
Lang:
rddord.txt
Component:
harbour
Doc. source:
.\doc\en\rddord.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Returns the Order Bag Name.
Syntax:
ORDBAGNAME( | ) --> cOrderBagName
Arguments:
A numeric value representing the Order bag number.
The character name of the Order Bag.
Returns:
ORDBAGNAME() returns the Order bag name
Description:
This function returns the name of the order bag for the specified
work area. If is specidied, it will represent the position
in the order list of the target order. If is specified,
it will represent the name of the target order. In essence, it will
tell the name of the database (if That Rdd is in use) for a given
index name or index order number. If is not specified
or is 0, the Current active order will be used.
Examples:
USE tests VIA "DBFCDX" NEW
SET INDEX TO tests
ORDBAGNAME( "TeName" ) // Returns: Customer
ORDBAGNAME( "TeLast" ) // Returns: Customer
ORDBAGNAME( "teZip" ) // Returns: Customer
SET ORDER TO TAG TeName
? OrderBagName() // Returns: Custumer
is a string that specifies the FOR condition for the
order.
is a code block that defines a FOR condition that
each record within the scope must meet in order to be processed. If
a record does not meet the specified condition, it is ignored and the
next record is processed.Duplicate keys values are not added to the
index file when a FOR condition is Used.
Returns:
Description:
Examples:
Status:
S
Compliance:
C
Files:
Library is rdd
See also:
ORDCREATE()
Lang:
rddord.txt
Component:
harbour
Doc. source:
.\doc\en\rddord.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Create an Order in an Order Bag
Syntax:
ORDCREATE(,[], ,
[], [])
Arguments:
Name of the file that contains one or more Orders.
Name of the order to be created.
Key value for order for each record in the current work area
Code block that evaluates to a key for the order for each
record in the work area.
Toggle the unique status of the index.
Returns:
Description:
This function creates an order for the current work area. It is
similar to the DBCREATEINDEX() except that this function allows
different orders based on the RDD in effect. The name of the file
or the name of the order are technically
both considered to be "optional" except that at least one of two
must exist in order to create the order.
The parameter is the index key expression; typically in
a .dbf driver, the maximum length of the key is 255 characters.
If is not specified, then the code block is create by
macro expanding the value of .
If is not specified, then the current internal setting of
SET UNIQUE ON or OFF will be observed.
The active RDD driver determines the capacity in the order for a
specific order bag.
If the name is found in the order bag can contain
a single order, the the name is erased and a new
order is added to the order list in the current or specified work
area.On the other hand, if it can contain multiples tags and if
does not already exist in the order list, then it is
added. It is does exist, then the replaces the former
name in the order list in the current or specified work area.
Examples:
USE tests VIA "DBFNDX" NEW
ORDCREATE( "FNAME",, "Tests->fName" )
USE tests VIA "DBFCDX" NEW
ORDCREATE( , "lName", "tests->lName" )
Status:
S
Compliance:
C
Files:
Library is rdd
See also:
DBCREATEINDEX(),ORDNAME(),ORDSETFOCUS()
ORDDESTROY()
Lang:
rddord.txt
Component:
harbour
Doc. source:
.\doc\en\rddord.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Remove an Order from an Order Bag
Syntax:
ORDDESTROY( [, ])
Arguments:
Name of the order to remove
Name of the order bag from which order id to be
removed
Returns:
Description:
This function attempts to remove the order named from the
file containing the order bag name . If
is not specified, then the name of the file will be based on the value
of the ORDNAME() function. If the extension is not included with the
name of the order file, then the extension will be obtained from the
default extension of the current and active RDD.
The DBFNTX driver do not support multiple order bags; therefore, there
cannot be an order to "destroy" from a bag. This function only works
for those drivers with support multiple orders bags (e.q. DBFCDX
and RDDADS drivers).
Examples:
USE tests VIA "DBFCDX" NEW
OrdDestroy( "lName", "tests" )
Status:
S
Compliance:
C
Files:
Library is rdd
See also:
ORDCREATE()
ORDFOR()
Lang:
rddord.txt
Component:
harbour
Doc. source:
.\doc\en\rddord.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Return the FOR expression of an Order
Syntax:
ORDFOR([, ]) --> cForExp
Arguments:
It the name of the target order,or the numeric position
of the order.
Name of the order bag.
Returns:
ORDFOR() returns a expression containing the FOR condition for
an order.
Description:
This function returns a character string that is the expression for
the FOR condition for the specified order. The order may be specified
if is the name of the order.However, may be an
numeric which represent the position in the order list of the desired
Order.
Examples:
USE tests NEW VIA "DBFCDX"
INDEX ON tests->ID ;
TO tests ;
FOR tests->ID > 100
ORDFOR( "tests" ) // Returns: tests->ID > 100
Status:
S
Compliance:
This function is CA-Cl*pper compliant with one exception:
If the paramter is not specified or is 0, the current
active order is used.
Files:
Library is rdd
See also:
ORDKEY(),ORDCREATE(),ORDNAME(),ORDNUMBER()
ORDKEY()
Lang:
rddord.txt
Component:
harbour
Doc. source:
.\doc\en\rddord.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Return the key expression of an Order
Syntax:
ORDKEY( | [, ]) --> cExpKey
Arguments:
It the name of the target order,or the numeric position
of the order.
Name of the order bag.
Returns:
Returns a character string, cExpKey.
Description:
Examples:
USE tests NEW VIA "DBFCDX"
INDEX ON tests->fName ;
TO tests ;
FOR tests->fName > "CK"
INDEX ON tests->Id TO TestId
ORDKEY( "tests" ) // Returns: tests->fName
SET ORDER TO 2
ORDKEY() // Returns: tests->Id
Status:
S
Compliance:
This function is CA-Cl*pper compliant with one exception:
If the paramter is not specified or is 0, the current
active order is used.
Files:
Library is rdd
See also:
ORDFOR(),ORDNAME(),ORDNUMBER(),ORDKEY()
OS()
Lang:
misc.txt
Component:
harbour
Doc. source:
.\doc\en\misc.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Return the current operating system.
Syntax:
OS() -->
Arguments:
Returns:
The current operating system.
Description:
This function will return the current operating system.
Examples:
? OS()
Status:
R
Compliance:
C
Files:
src/rtl/version.c
See also:
OUTERR()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Procedure
Category:
API
Subcategory:
User interface
Oneliner:
Write a list of values to the standard error device
Syntax:
OUTERR( )
Arguments:
is a list of expressions to display. Expressions are any
mixture of Harbour data types.
Returns:
Description:
OUTERR() write one or more values into the standard error device.
Character and Memo values are printed as is, Dates are printed
according to the SET DATE FORMAT, Numeric values are converted to
strings, Logical values are printed as .T. or .F., NIL are printed
as NIL, values of any other kind are printed as empty string. There
is one space separating each two values. Note that Numeric value can
take varying length when converted into string depending on its
source (see STR() for detail).
There is an undocumented CA-Cl*pper command line switch //STDERR
which can set the file handle to write output from OUTERR(). If not
specified the default STDERR is used, //STDERR or //STDERR:0 set
OUTERR() to output to the same file handle as OUTSTD(), //STDERR:n
set output to file handle n. Like other undocumented features this
switch is available only if src/rtl/console.c was compiled with
the HB_CLP_UNDOC flag.
Write a list of values to the standard output device
Syntax:
OUTSTD( )
Arguments:
is a list of expressions to display. Expressions are any
mixture of Harbour data types.
Returns:
Description:
OUTSTD() write one or more values into the standard output device.
Character and Memo values are printed as is, Dates are printed
according to the SET DATE FORMAT, Numeric values are converted to
strings, Logical values are printed as .T. or .F., NIL are printed
as NIL, values of any other kind are printed as empty string. There
is one space separating each two values. Note that Numeric value can
take varying length when converted into string depending on its
source (see STR() for detail).
OUTSTD() is similar to QQOUT() with the different that QQOUT() send
its output to the Harbour console stream, which can or can not be
redirected according with the screen driver, and OUTSTD() send its
output to the standard output device (STDOUT) and can be redirected.
The Harbour project************************************************************************* This file contains information on obtaining, installing, and using ** Harbour. Please read it *completely* before asking for help. *************************************************************************
Harbour is a free implementation of an xBase language compiler. It is
designed to be source code compatible with the CA-Cl*pper(r) compiler.
That means that if you've got some code that would compile using
CA-Cl*pper(r) then it should compile under Harbour. The Harbour-Project
web page is:
http://harbour-project.org/
Status and other information is always available from the web site.
There is a Harbour mailing list. Harbour is still at a very early
stage of development, so the mailing list is very much a Developers
only list, although every body is welcome to join in the discussions.
We would like you to join the Harbour development team. If you are
interested you may suscribe to our mailing list and start contributing
to this free public project.
Please feel free to report all questions, ideas, suggestions, fixes,
code, etc. you may need and want. With the help of all of you, the Harbour
compiler and runtime libraries will become a reality very soon.
What this distribution contains
===============================
This distribution is a Source code only distribution. It does not contain
any executable files. Executable versions of Harbour are available from
the web site. Executable versions of Harbour DO NOT create runable
programs. Harbour at the moment produces C output code, which must be
compiled with the Harbour Virtual Machine and the support libraries
in order to create a functioning program.
Please test running Harbour against your CA-Cl*pper source code and report
any problems that might occur.
Very important: The preprocessor functionality is now working.
Installation
------------
1. Unzip with Harbour zip file using pkunzip or equivalent.
E.G. pkunzip -d build72.zip
This will create Harbour/ directory and all the relevant sub
directories.
2. Compile Harbour using your C compiler. Make files for different
platforms are included in the directory.
--- COPYRIGHT ---
What copyright information do we have
--- LICENCE ---
Information about the License for usage of Harbour is available in the
file licence.txt (when we have a license)
--- DISCLAIMER ---
Participants of The Harbour Project assume no responsibility for errors or
omissions in these materials.
THESE MATERIALS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
Participants of The Harbour Project further do not warrant the accuracy or
completeness of the code, information, text, output or any other items
contained within these materials. Participants of The Harbour Project
shall not be liable for any special, direct, indirect, incidental, or
consequential damages, including without limitation, lost revenues or
lost profits, which may result from the use or mis-use of these materials.
The information in The Harbour Project is subject to change without notice
and does not represent any future commitment by the participants of The
Harbour Project.
The Harbour Project
Examples:
Status:
Compliance:
Files:
See also:
License
PACK
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Command
Category:
Command
Subcategory:
Database
Oneliner:
Remove records marked for deletion from a database
Syntax:
PACK
Arguments:
(This command has no arguments)
Returns:
Description:
This command removes records that were marked for deletion from the
currently selected database. This command does not pack the contents
of a memo field; those files must be packed via low-level fuctions.
All open index files will be automatically reindexed once PACK command
has completed its operation. On completion, the record pointer is placed
on the first record in the database.
Examples:
USE tests NEW INDEX tests
DBGOTO( 10 )
DELETE NEXT 10
PACK
USE
Status:
R
Compliance:
C
Files:
See also:
DBEVAL(), DELETE, DELETED(), ZAP, RECALL
PADC()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Centers an expression for a given width
Syntax:
PADC( , , ) --> cString
Arguments:
A Number, Character or Date value to pad
Width of output string
Character to fill in the string
Returns:
The Center string of
Description:
This function takes an date, number or character expression
and attempt to center the expression within a string of a given width
expressed as . The default character used to pad either side
of will be a blank space. This character may be explicitly
specified the value of .
If the length of is longer then , this function will
truncate the string from the leftmost side to the length of
.
An number,Character or date to pad
Width of output string
Character to fill in the string
Returns:
The left-justifies string of
Description:
This function takes an date,number,or character expression
and attempt to left-justify it within a string of a given width
expressed as . The default character used to pad left side
of will be an blank space; however, this character may be
explicitly specified the value of .
If the length of is longer then , this function will
truncate the string from the leftmost side to the length of
.
A Number, Character or Date value to pad
Width of output string
Character to fill in the string
Returns:
The right-justifies string of
Description:
This function takes an date,number,or character expression
and attempt to right-justify it within a string of a given width
expressed as . The default character used to pad right side
of will be an blank space; however, this character may be
explicitly specified the value of .
If the length of is longer then , this function will
truncate the string from the leftmost side to the length of
.
amount of money you get from the bank
rate of interest per period, 1 == 100%
period count
Returns:
Periodical payment one has to make to pay the
loan back
Description:
PAYMENT() calculates the payment one has to make periodically
to pay back a loan within periods and for a
rate of interest per period.
debt in period 0 =
debt in period 1 = ((debt in period 0)-)*(1+/100)
debt in period 2 = ((debt in period 1)-)*(1+/100)
etc...
debt in period = ((debt in period -1)-)*(1+/100)
-> has to be 0, so
= *(/100)/(1-(1+/100)^(-n))
Examples:
// You get a loan of 5172.56 at a interest rate of 0.5% per
// month (6% per year).
// For 5 years, you have to pay back every month
? payment (5172.56, 0.005, 60) --> 100.00
Status:
Ready
Compliance:
PAYMENT() is compatible with CT3's PAYMENT().
Files:
Source is finan.c, library is libct.
See also:
PV(),FV(),PERIODS(),RATE()
PCOUNT()
Lang:
hvm.txt
Component:
harbour
Doc. source:
.\doc\en\hvm.txt
Template:
Function
Category:
API
Subcategory:
Application
Oneliner:
Retrieves the number of arguments passed to a function.
Syntax:
PCOUNT() -->
Arguments:
None
Returns:
A number that indicates the number of arguments
passed to a function or procedure.
Description:
This function is useful to check if a function or procedure
has received the required number of arguments.
Examples:
See Test
Status:
R
Compliance:
C
Files:
Library is vm
See also:
HB_PVALUE()
PERIODS()
Lang:
finan.txt
Component:
hbct
Doc. source:
hbct\doc\en\finan.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Number of periods for a loan
Syntax:
PERIODS (nLoan, nPayment, nInterest) --> nPeriods
Arguments:
amount of money you get from the bank
amount of money you pay back per period
rate of interest per period, 1 == 100%
Returns:
number of periods you need to pay the loan back
Description:
PERIODS() calculates the number of periods one needs to pay back
a loan of with periodical payments of and for a
rate of interest per period.
debt in period 0 =
debt in period 1 = ((debt in period 0)-)*(1+/100)
debt in period 2 = ((debt in period 1)-)*(1+/100)
etc...
debt in period = ((debt in period -1)-)*(1+/100)
-> has to be 0, so
= -log(1-*(/100)/)/log(1+/100))
Note, however that in the case of nPayment <= *(/100),
one would need infinite time to pay the loan back. The functions does
then return -1.
Examples:
// You get a loan of 5172.56 at a interest rate of 0.5% per
// month (6% per year).
// You can afford to pay 100 back every month, so you need
? periods (5172.56, 100, 0.005) --> 60.0
// months to cancel the loan.
Status:
Ready
Compliance:
PERIODS() is compatible with CT3's PERIODS().
Files:
Source is finan.c, library is libct.
See also:
PV(),FV(),PAYMENT(),RATE()
PI()
Lang:
trig.txt
Component:
hbct
Doc. source:
hbct\doc\en\trig.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Returns Pi, the perimeter-to-diameter-ratio of a circle
Syntax:
PI () -> nPi
Arguments:
Returns:
the math constant Pi with maximum precision available
Description:
The function PI() can be used if the constant Pi is needed
with maximum precision. One of the most known interpretations of this
number is the constant perimeter-to-diameter-ratio of circles.
Examples:
// the diameter of a circle-like swimming pool is 3.4 meters, how
// long is the perimeter ?
? str(PI()*3.4,5,3)+" meters" --> 10.681 meters
Replace character at a certain position within a string
Syntax:
POSCHAR (<[@]cString>, , []) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSCHAR() is compatible with CT3's POSCHAR().
Files:
Source is pos2.c, library is libct.
See also:
POSDEL(),POSINS(),POSREPL(),CSETREF()
POSDEL()
Lang:
pos2.txt
Component:
hbct
Doc. source:
hbct\doc\en\pos2.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Delete characters at a certain position within a string
Syntax:
POSDEL (, [], ) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSDEL() is compatible with CT3's POSDEL().
Files:
Source is pos2.c, library is libct.
See also:
POSCHAR(),POSINS(),POSREPL()
POSDIFF()
Lang:
posdiff.txt
Component:
hbct
Doc. source:
hbct\doc\en\posdiff.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
The left-most position there two string differ
Syntax:
POSDIFF (, , []) -> nPosition
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSDIFF() is compatible with CT3's POSDIFF().
Files:
Source is posdiff.c, library is libct.
See also:
POSEQUAL()
POSEQUAL()
Lang:
posdiff.txt
Component:
hbct
Doc. source:
hbct\doc\en\posdiff.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
The left-most position there two string begin to be equal
Syntax:
POSEQUAL (, , [], []) -> nPosition
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSEQUAL() is compatible with CT3's POSEQUAL().
Files:
Source is posdiff.c, library is libct.
See also:
POSDIFF()
POSINS()
Lang:
pos2.txt
Component:
hbct
Doc. source:
hbct\doc\en\pos2.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Insert characters at a certain position within a string
Syntax:
POSINS (, , []) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSINS() is compatible with CT3's POSINS().
Files:
Source is pos2.c, library is libct.
See also:
POSCHAR,POSDEL(),POSREPL()
POSLOWER()
Lang:
pos1.txt
Component:
hbct
Doc. source:
hbct\doc\en\pos1.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Left-most position of a lowercase letter in a string
Syntax:
POSLOWER (, [], []) -> nPosition
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSLOWER() is compatible with CT3's POSLOWER().
Files:
Source is pos1.c, library is libct.
See also:
POSALPHA(),POSUPPER(),POSRANGE()
POSRANGE()
Lang:
pos1.txt
Component:
hbct
Doc. source:
hbct\doc\en\pos1.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Left-most position of a character from a set in a string
Syntax:
POSRANGE (, , , [],
[]) -> nPosition
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSRANGE() is compatible with CT3's POSRANGE().
Files:
Source is pos1.c, library is libct.
See also:
POSALPHA(),POSLOWER(),POSUPPER()
POSREPL()
Lang:
pos2.txt
Component:
hbct
Doc. source:
hbct\doc\en\pos2.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Replace characters at a certain position within a string
Syntax:
POSREPL (<[@]cString>, , []) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSREPL() is compatible with CT3's POSREPL().
Files:
Source is pos2.c, library is libct.
See also:
POSCHAR(),POSDEL(),POSINS(),CSETREF()
POSUPPER()
Lang:
pos1.txt
Component:
hbct
Doc. source:
hbct\doc\en\pos1.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Left-most position of an uppercase letter in a string
Syntax:
POSUPPER (, [], []) -> nPosition
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
POSUPPER() is compatible with CT3's POSUPPER().
Files:
Source is pos1.c, library is libct.
See also:
POSALPHA(),POSLOWER(),POSRANGE()
PRINTREADY()
Lang:
print.txt
Component:
hbct
Doc. source:
hbct\doc\en\print.txt
Template:
Category:
CT3 printer functions
Subcategory:
Oneliner:
Syntax:
PRINTREADY ([]) -> lPrinterReady
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Library is libct.
See also:
PRINTSTAT()
Lang:
print.txt
Component:
hbct
Doc. source:
hbct\doc\en\print.txt
Template:
Category:
CT3 printer functions
Subcategory:
Oneliner:
Syntax:
PRINTSTAT ([]) -> nState
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is print.c, library is libct.
See also:
PROCFILE()
Lang:
hvm.txt
Component:
harbour
Doc. source:
.\doc\en\hvm.txt
Template:
Function
Category:
API
Subcategory:
Application
Oneliner:
This function allways returns an empty string.
Syntax:
PROCFILE( ) -->
Arguments:
is any valid type.
Returns:
Return an empty string
Description:
This function is added to the RTL for full compatibility. It
always returns an empty string.
Examples:
? ProcFile()
Status:
R
Compliance:
C
Files:
Library is vm
See also:
PROCNAME(),PROCLINE()
PROCLINE()
Lang:
hvm.txt
Component:
harbour
Doc. source:
.\doc\en\hvm.txt
Template:
Function
Category:
API
Subcategory:
Application
Oneliner:
Gets the line number of the current function on the stack.
Syntax:
PROCLINE( ) -->
Arguments:
is the function level required.
Returns:
The line number of the function that it is being executed.
Description:
This function looks at the top of the stack and gets the current
line number of the executed function if no arguments are passed.
Otherwise it returns the line number of the function or procedure
at .
Examples:
See Test
Status:
R
Compliance:
C
Files:
Library is vm
See also:
PROCNAME(),PROCFILE()
PROCNAME()
Lang:
hvm.txt
Component:
harbour
Doc. source:
.\doc\en\hvm.txt
Template:
Function
Category:
API
Subcategory:
Application
Oneliner:
Gets the name of the current function on the stack
Syntax:
PROCNAME( ) -->
Arguments:
is the function level required.
Returns:
The name of the function that it is being executed.
Description:
This function looks at the top of the stack and gets the current
executed function if no arguments are passed. Otherwise it returns
the name of the function or procedure at .
amount of money paid back per period
rate of interest per period, 1 == 100%
period count
Returns:
Present value of a loan when one is paying back
per period at a rate of interest of
per period
Description:
PV() calculates the present value of a loan that is paid back
in payments of (Dollars, Euros, Yens,...)
while the rate of interest is per period:
debt in period 0 =
debt in period 1 = ((debt in period 0)-)*(1+/100)
debt in period 2 = ((debt in period 1)-)*(1+/100)
etc...
debt in period = ((debt in period -1)-)*(1+/100)
-> has to be 0, so
= *(1-(1+/100)^(-n))/(/100)
Examples:
// You can afford to pay back 100 Dollars per month for 5 years
// at a interest rate of 0.5% per month (6% per year), so instead
// of 6000 Dollars (the amount you will pay back) the bank will pay
// you
? pv (100, 0.005, 60) --> 5172.56
An instance of the object of type QWindowStateChangeEvent
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
QWizard()
Lang:
class_qwizard.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_qwizard.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new QWizard object.
Syntax:
QWizard( ... )
Arguments:
Returns:
An instance of the object of type QWizard
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
QWizardPage()
Lang:
class_qwizardpage.txt
Component:
qtgui
Doc. source:
hbqt\qtgui\doc\en\class_qwizardpage.txt
Template:
Class
Category:
Harbour Bindings for Qt
Subcategory:
GUI
Oneliner:
Creates a new QWizardPage object.
Syntax:
QWizardPage( ... )
Arguments:
Returns:
An instance of the object of type QWizardPage
Description:
Examples:
Status:
R
Compliance:
Not Clipper compatible
Files:
Library: hbqtgui
See also:
RANGEREM()
Lang:
range.txt
Component:
hbct
Doc. source:
hbct\doc\en\range.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Remove characters within a certain ASCII range from a string
Syntax:
RANGEREM (, , ) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
? rangerem ("0","9","year2002.dbf") // "year.dbf", remove all digits
? rangerem ("9","0","year2002.dbf") // "22", testing removal from "9" to chr(255)
// and from chr(0) to "0"
? rangerem ("0","9","yearcurr.dbf") // "yearcurr.dbf", test leaving string untouched
Status:
Started
Compliance:
RANGEREM() is compatible with CT3's RANGEREM().
Files:
Source is range.c, library is libct.
See also:
RANGEREPL()
RANGEREPL
Lang:
range.txt
Component:
hbct
Doc. source:
hbct\doc\en\range.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Replace characters within a certain ASCII range from a string
Syntax:
RANGEREPL (, ,
<[@]cString>, ) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
? rangerepl ("0","9","year2002.dbf","?") // "year????.dbf", replace all digits
? rangerepl ("9","0","year2002.dbf","?") // "????2??2????", testing replacement from "9" to chr(255)
// and from chr(0) to "0"
? rangerepl ("0","9","yearcurr.dbf","?") // "yearcurr.dbf", test leaving string untouched
Status:
Started
Compliance:
RANGEREPL() is compatible with CT3's RANGEREPL().
Files:
Source is range.c, library is libct.
See also:
RANGEREM()
RAT()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Searches for a substring from the right side of a string.
Syntax:
RAT( , ) --> nPos
Arguments:
Substring to search for
Main string
Returns:
RAT() return the location of beginning position.
Description:
This function searches through for the first existence
of . The search operation is performed from the right side
of to the left. If the function is unable to find any
occurrence of in , the return value is 0.
amount of money you get from the bank
amount of money you pay back per period
number of periods you pay the loan back
Returns:
estimated rate of interest per period, 1 == 100%
Description:
RATE() calculates the rate of interest per period for the given
loan, payment per periods and number of periods. This is done with
the same equation used in the PAYMENT() or PERIODS() function:
= *(/100)/(1-(1+/100)^(-))
However, this equation can not be solved for in a "closed"
manner, i.e. = ..., so that the result can only be estimated.
Examples:
// You get a loan of 5172.56, pay 100 back every month for
// 5 years (60 months). The effective interest rate per
// period (=month) is
? rate (5172.56, 100, 60) --> 0.005
Status:
Ready
Compliance:
RATE() is compatible with CT3's RATE().
Files:
Source is finan.c, library is libct.
See also:
PV(),FV(),PAYMENT(),PERIODS()
RD()
Lang:
ht_file.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_file.txt
Template:
Category:
Dos Tools
Subcategory:
Oneliner:
Remove a Directory
Syntax:
RD() -->
Arguments:
DIR TO BE DELETED
Returns:
.T. IF SUCESSFUL; otherwise .F.
Description:
REMOVE A DIRECTORY
Examples:
IF RD("OLA")
RETURN .T.
ELSE
RETURN .F.
ENDIF
Status:
Compliance:
Files:
Header is Fileio.ch
See also:
CD(),MD()
READKEY()*
Lang:
input.txt
Component:
harbour
Doc. source:
.\doc\en\input.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Determine which key terminated a READ.
Syntax:
READKEY() --> nKeyCode
Arguments:
None.
Returns:
READKEY() returns a numeric code representing the key that caused READ
to terminate.
Description:
READKEY() is used after a READ was terminated to determine the exit
key pressed. If the GET buffer was updated during READ, 256 is added
to the return code.
READKEY() is a compatibility function so try not to use it.
READKEY() is superseded by LASTKEY() which returns the INKEY()
code for that key. UPDATED() could be used to find if the
GET buffer was changed during the READ.
READVAR() return the old variable name. If no variable previously
was set, READVAR() return "".
Description:
READVAR() is set inside a READ or MENU TO command to hold the
uppercase name of the GET / MENU TO variable, and re-set back to old
value when those commands finished. You should not normally set a
variable name but rather use it to retrieve the name of a GET
variable when executing a VALID or WHEN clause, or during SET KEY
execution and you are inside a READ or MENU TO.
Examples:
// display a menu, press F1 to view the MENU TO variable name
CLS
@ 1, 10 PROMPT "blood sucking insect that infect beds "
@ 2, 10 PROMPT "germ; virus infection "
@ 3, 10 PROMPT "defect; snag; (source of) malfunctioning"
@ 4, 10 PROMPT "small hidden microphone "
@ 6, 10 SAY "(Press F1 for a hint)"
SET KEY 28 TO ShowVar
MENU TO What_Is_Bug
PROCEDURE ShowVar
Alert( ReadVar() ) // WHAT_IS_BUG in red ALERT() box
Status:
R
Compliance:
READVAR() works exactly like CA-Cl*pper's READKEY().
Note however,
that the parameter is not documented and used internally
by CA-Cl*pper.
The number of records
CRIPTION$*
This function returns the number of records present in the database
in the selected or designated work area. If no records are present
the value of this function will be 0. Additionaly, if no database is
in use in the selected or designated work area, this function will
return a 0 value as well.
Description:
Examples:
USE test NEW
USE harbour NEW
? RecCount()
? Test->( RecCount() )
CLOSE ALL
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
EOF(),LASTREC(),RECNO(),DBGOBOTTOM()
RECNO()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Returns the current record number or identity.
Syntax:
RECNO() --> Identity
Arguments:
(This function has no arguments)
Returns:
RECNO() The record number or identity
Description:
This function returns the position of the record pointer in the
currently selected ot designated work area.
If the database file is empty and if the RDD is the traditional .dbf
file, the value of this function will be 1.
Examples:
USE tests NEW
DBGOTOP()
RECNO() // Returns 1
DBGOTO( 50 )
RECNO() // Returns 50
Returns the size of a single record in an active database.
Syntax:
RECSIZE() --> nBytes
Arguments:
(This function has no arguments)
Returns:
The record size.
Description:
This function returns the number os bytes used by a single record
in the currently selected or designated database file. If no database
is in use in this work area, the return value from this function
will be 0.
Examples:
USE tests NEW
DBGOTOP()
RECSIZE() // Returns 1
DBGOTO( 50 )
RECSIZE()
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
DISKSPACE(),FIELDNAME(),HEADER(),LASTREC()
REMALL()
Lang:
remove.txt
Component:
hbct
Doc. source:
hbct\doc\en\remove.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Remove certain characters at the left and right of a string
Syntax:
REMALL (, []) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
REMALL() is compatible with CT3's REMALL().
Files:
Source is remove.c, library is libct.
See also:
REMLEFT(),REMRIGHT()
REMLEFT()
Lang:
remove.txt
Component:
hbct
Doc. source:
hbct\doc\en\remove.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Remove certain characters at the left of a string
Syntax:
REMLEFT (, []) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
REMLEFT() is compatible with CT3's REMLEFT().
Files:
Source is remove.c, library is libct.
See also:
REMALL(),REMRIGHT()
REMRIGHT()
Lang:
remove.txt
Component:
hbct
Doc. source:
hbct\doc\en\remove.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Remove certain characters at the right of a string
Syntax:
REMRIGHT (, []) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
REMRIGHT() is compatible with CT3's REMRIGHT().
Files:
Source is remove.c, library is libct.
See also:
REMALL(),REMLEFT()
RENAME
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Command
Category:
Command
Subcategory:
FileSys
Oneliner:
Changes the name of a specified file
Syntax:
RENAME TO
Arguments:
Old filename
New Filename
Returns:
Description:
This command changes the name of to . Both
and must include a file extension. This command
if not affected by the SET PATH TO or SET DEFAULT TO commands;drive
and directory designates must be specified if either file is in a
directory other then the default drive and directory.
If id currently open or if it previously exists, this
command will not perform the desired operation.
Examples:
RENAME hello.txt TO hello.old
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
CURDIR(),ERASE,FILE(),FERASE(),FRENAME()
REPLALL()
Lang:
replace.txt
Component:
hbct
Doc. source:
hbct\doc\en\replace.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Replace certain characters at the left and right of a string
Syntax:
REPLALL (, , []) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
REPLALL() is compatible with CT3's REPLALL().
Files:
Source is replace.c, library is libct.
See also:
REPLLEFT(),REPLRIGHT()
REPLICATE()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Repeats a single character expression
Syntax:
REPLICATE( , ) --> cReplicateString
Arguments:
Character string to be replicated
Number of times to replicate
Returns:
A character expression contain the
fill character.
Description:
This function returns a string composed of repetitions of
. The length of the character string returned by this
function is limited to the memory available.
A value of 0 for will return a NULL string.
Name of report file
Name of alternate file
Scope.
Logical expression of WHILE condition .
Logical expression of FOR condition.
Report heading
Returns:
Description:
This command prints out the report named , which is a
standard FRM file. The file extension is not required because .frm
will be assumed. The SET PATH TO and SET DEFAULT TO commands affect
the search for the file ; unless a drive and path are
specified in , REPORT will search the path specified in
the SET PATH command if it cannot find the report form in the
current directory.
The output of the report will be offset based on the setting of the
SET MARGIN TO value.
By default, output will go to the console; however, it may be
controlled via either the TO PRINTER or TO FILE clause. If the
output is to go to the file, the name of the alternate file is
specified in . Unless specified in , the default file
extension will be TXT.
is the scope for this command. Valid scopes include
NEXT (where is the number of records), RECORD
(a specific record to be displayed), REST (all records from the
current record position), and ALL (all records). The default is ALL.
Both logical expressions may work in conjuntion with one another,
where is the logical expression for the FOR condition (for
records to be displayed within a given range) and for the
WHILE condition (for records to be displayed until the condition
fails).
If the PLAIN clause is specified, date and page numbers are
suppressed. In addition, there is no automatic page breaking, and
the report title and column headings appear only once at the top of
the form.
If the HEADING clause is used, is displayed on the first
title of each report page. The value of is evaluated only
once before executing the report; varying the values of
is not allowed. The PLAIN clause will take precedence over the
HEADING clause if both are included.
If the NOEJECT clause is used, the initial page eject on the report
will not be issued when the output clause TO PRINTER is specified.
Otherwise, this clause has no effect.
If the SUMMARY Clause is specified, the report will contain only
groups, subgroups, and grand total information. The detailed title
item information will be ignored.
If the NOCONSOLE clause is specified,output to the console will be
turned off while this command is being executed.
Examples:
PROCEDURE Main()
USE test NEW
REPORT FORM EE
USE
RETURN
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
LABEL FORM
RESTORE SCREEN
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Command
Category:
API
Subcategory:
Terminal
Oneliner:
Restore screen image and coordinate from an internal buffer
Syntax:
RESTORE SCREEN
Arguments:
none.
Returns:
Description:
Rest Screen restore saved image of the whole screen from an
internal buffer that was saved by Save Screen, it also restore
cursor position. After a call to Rest Screen the internal buffer
is cleared.
RESTORE SCREEN command is preprocessed into __XRestScreen() function
during compile time. Note that RESTORE SCREEN FROM is preprocessed
into RESTSCREEN() function.
Examples:
// save the screen, display list of files than restore the screen
SAVE SCREEN
DIR *.*
WAIT
RESTORE SCREEN
Status:
R
Compliance:
C
Files:
See also:
__XRESTSCREEN(),SAVE SCREEN,__XSAVESCREEN()
RESTTOKEN()
Lang:
token2.txt
Component:
hbct
Doc. source:
hbct\doc\en\token2.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Restore global token environment
Syntax:
RESTTOKEN () -> cOldStaticEnvironment
Arguments:
a binary string encoding a TE
Returns:
a string encoding the old global TE
Description:
The RESTTOKEN() function restores the global TE to the one encoded
in . This can either be the return value
of SAVETOKEN() or the value stored in the 4th parameter in a
TOKENINIT() call.
Examples:
Status:
Ready
Compliance:
RESTTOKEN() is compatible with CTIII's RESTTOKEN(),
Extract the rightmost substring of a character expression
Syntax:
RIGHT( , ) --> cReturn
Arguments:
Character expression to be parsed
Number of bytes to return beginning at the rightmost position
Returns:
Substring of evaluation
Description:
This functions returns the rightmost characters of .
It is equivalent to the following expressions:
SUBSTR( , - )
SUBSTR( , LEN( ) - + 1, )
Examples:
? RIGHT( "HELLO HARBOUR", 5 ) // RBOUR
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
SUBSTR(),LEFT(),AT(),RAT()
RLOCK()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Lock a record in a work area
Syntax:
RLOCK() --> lSuccess
Arguments:
(This function has no arguments)
Returns:
RLOCK() True (.T.) if record lock is successful; otherwise, it
returns false (.F.).
Description:
This function returns a logical true (.T.) if an attempt to lock a
specific record in a selected or designated work area is successful.
It will yield a false (.F.) if either the file or the desired record
is currently locked.
A record that is locked remains locked until another RLOCK() is issued
or until an UNLOCK command is executed.
On a Network enviroment the follow command need that the record is
locked:
@...GET
DELETE (single record)
RECALL (single record)
REPLACE (single record)
Examples:
nId := 10
USE testid INDEX testid NEW
IF testid->( DBSEEK( nId ) )
IF testid->( RLOCK() )
DBDELETE()
ENDIF
ENDIF
USE
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
FLOCK()
ROUND()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
API
Subcategory:
Math
Oneliner:
Rounds off a numeric expression.
Syntax:
ROUND( , ) -->
Arguments:
Any numeric value.
The number of places to round to.
Returns:
The rounded number.
Description:
This function rounds off the value of to the number of
decimal places specified by . If the value of is
a negative number, the function will attempt to round in
whole numbers. Numbers from 5 through 9 will be rounded up, all
others will be rounded down.
This function returns the current cursor row location. The value
for this function can range between 0 and MAXCOL().
Examples:
? Row()
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
COL(),MAXROW(),MAXCOL()
RTOD()
Lang:
trig.txt
Component:
hbct
Doc. source:
hbct\doc\en\trig.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Convert radiant to degree
Syntax:
RTOD (nRadiant) -> nDegree
Arguments:
the size of an angle in radiant
Returns:
the size of that angle in degree
Description:
The function RTOD() can be used to convert sizes of angles given
in radiant (like those returned by the asin, acos or atan function)
to degrees that are commonly used geometry and technics.
This function returns the value of with any trailing blank
removed.
This function is identical to RTRIM() and the opposite of LTRIM().
Together with LTRIM(), this function equated to the ALLTRIM()
function.
This command runs an external program. Please make sure that you have
enough free memory to be able to run the external program.
Do not use it to run Terminate and Stay Resident programs
(in case of DOS) since that causes several problems.
Examples:
RUN ( "edit " + cMyTextFile ) // Runs an external editor
RUN command // Gives a DOS shell (DOS only)
Status:
R
Compliance:
C
Files:
src/rtl/run.c
Library is rtl
See also:
RUN
SAVE SCREEN
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Command
Category:
API
Subcategory:
Terminal
Oneliner:
Save whole screen image and coordinate to an internal buffer
Syntax:
SAVE SCREEN
Arguments:
none.
Returns:
Description:
SAVE SCREEN save the image of the whole screen into an internal
buffer, it also save current cursor position. The information could
later be restored by REST SCREEN. Each call to SAVE SCREEN
overwrite the internal buffer.
SAVE SCREEN command is preprocessed into __XSaveScreen() function
during compile time. Note that SAVE SCREEN TO is preprocessed into
SAVESCREEN() function.
Examples:
// save the screen, display list of files than restore the screen
SAVE SCREEN
DIR *.*
WAIT
RESTORE SCREEN
Status:
R
Compliance:
C
Files:
See also:
RESTORE SCREEN,__XRESTSCREEN(),__XSAVESCREEN()
SAVETOKEN()
Lang:
token2.txt
Component:
hbct
Doc. source:
hbct\doc\en\token2.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Save the global token environment
Syntax:
SAVETOKEN () -> cStaticTokenEnvironment
Arguments:
Returns:
a binary string encoding the global TE
Description:
The SAVETOKEN() function can be used to store the global TE for future
use or when two or more incremental tokenizers must the nested.
Note however that the latter can now be solved with locally stored
token environments.
Examples:
Status:
Ready
Compliance:
SAVETOKEN() is compatible with CTIII's SAVETOKEN(),
- the string to output. Although undocumented, can be NIL.
- row number, defaults to cursor row.
- column number, defaults to cursor column.
Returns:
Returns an empty string.
Description:
Outputs a string at specified coordinates without changing character
attributes.
Examples:
Status:
Ready
Compliance:
Files:
Source is screen1.c, library is libct.
See also:
SCREENMIX()
SCREENATTR()
Lang:
screen1.txt
Component:
hbct
Doc. source:
hbct\doc\en\screen1.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Syntax:
SCREENATTR ( [],[] ) ->
Arguments:
Designates the line from which to determine the attribute.
The default is the cursor line.
Designates the column from which to determine the
attribute. The default is the cursor column.
Returns:
SCREENATTR() returns the attribute at the designated position.
Description:
SCREENATTR() returns the current screen attribute at and
. You can query targeted attributes this way and save them
to use later, or process them later with INVERTATTR().
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is screen1.c, library is libct.
See also:
SCREENMIX()
Lang:
screen1.txt
Component:
hbct
Doc. source:
hbct\doc\en\screen1.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Syntax:
SCREENMIX (, , [], []) ->
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is screen1.c, library is libct.
See also:
SCREENTEXT()
Lang:
screen1.txt
Component:
hbct
Doc. source:
hbct\doc\en\screen1.txt
Template:
Category:
CT video functions (Harbour extension)
Subcategory:
Oneliner:
Syntax:
SCREENTEXT(, , , )
Arguments:
- top row number, default 0
- left column number, default 0
- top row number, default MaxRow()
- right column number, default MaxCol()
Returns:
Returns string with characters taken from given screen region.
Description:
Returns string with characters taken from given screen region.
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is screen1.c, library is libct.
See also:
SECONDS()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Returns the number of elapsed seconds past midnight.
Syntax:
SECONDS() --> nSeconds
Arguments:
None
Returns:
Number of seconds since midnight
Description:
This function returns a numeric value representing the number of
elapsed seconds based on the current system time.
The system time is considered to start at 0 (midnight); it continues
up to 86399 seconds. The value of the return expression is displayed
in both seconds and hundredths of seconds.
Examples:
? Seconds()
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
TIME()
SECS()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Return the number of seconds from the system date.
Syntax:
SECS( ) --> nSeconds
Arguments:
Character expression in a time string format
Returns:
Number of seconds
Description:
This function returns a numeric value that is a number of elapsed
seconds from midnight based on a time string given as .
Examples:
? Secs( Time() )
? Secs( Time() - 10 )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
SECONDS(),ELAPTIME(),TIME()
SELECT()
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Returns the work area number for a specified alias.
Syntax:
SELECT([]) --> nWorkArea
Arguments:
is the target work area alias name.
Returns:
SELECT() returns the work area number.
Description:
This function returns the work area number for the specified alias
name . If no parameter is specified, the current work area will
be the return value of the function.
Examples:
USE tests NEW
USE names NEW
cOldArea := Select( "names" )
SELECT test
LIST
SELECT cOldArea
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
ALIAS(), USED()
SELF_ADDFIELD()
Lang:
hb_apird.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apird.txt
Template:
Function
Category:
C level API
Subcategory:
RDD
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapirdd.h"
SELF_ADDFIELD( w, ip ) --> lprfsHost->addField )( w, ip ) )>
Arguments:
Returns:
lprfsHost->addField )( w, ip ) )>
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapirdd.h
See also:
SELF_ALIAS()
Lang:
hb_apird.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apird.txt
Template:
Function
Category:
C level API
Subcategory:
RDD
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapirdd.h"
SELF_ALIAS( w, bp ) --> lprfsHost->alias )( w, bp ) )>
Arguments:
Returns:
lprfsHost->alias )( w, bp ) )>
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapirdd.h
See also:
SELF_APPEND()
Lang:
hb_apird.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apird.txt
Template:
Function
Category:
C level API
Subcategory:
RDD
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapirdd.h"
SELF_APPEND( w, l ) --> lprfsHost->append )( w, l ) )>
C Prototype (macro definition)
#include "hbapirdd.h"
SELF_TRANS( w, ip ) --> lprfsHost->trans )( w, ip ) )>
Arguments:
Returns:
lprfsHost->trans )( w, ip ) )>
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapirdd.h
See also:
SELF_TRANSREC()
Lang:
hb_apird.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apird.txt
Template:
Function
Category:
C level API
Subcategory:
RDD
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapirdd.h"
SELF_TRANSREC( w, ip ) --> lprfsHost->transRec )( w, ip ) )>
Arguments:
Returns:
lprfsHost->transRec )( w, ip ) )>
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapirdd.h
See also:
SELF_UNLOCK()
Lang:
hb_apird.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apird.txt
Template:
Function
Category:
C level API
Subcategory:
RDD
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapirdd.h"
SELF_UNLOCK( w, l ) --> lprfsHost->unlock )( w, l ) )>
Arguments:
Returns:
lprfsHost->unlock )( w, l ) )>
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapirdd.h
See also:
SELF_WRITEDBHEADER()
Lang:
hb_apird.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apird.txt
Template:
Function
Category:
C level API
Subcategory:
RDD
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapirdd.h"
SELF_WRITEDBHEADER( w ) --> lprfsHost->writeDBHeader )( w ) )>
Arguments:
Returns:
lprfsHost->writeDBHeader )( w ) )>
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapirdd.h
See also:
SELF_ZAP()
Lang:
hb_apird.txt
Component:
harbour
Doc. source:
.\doc\en\hb_apird.txt
Template:
Function
Category:
C level API
Subcategory:
RDD
Oneliner:
Syntax:
C Prototype (macro definition)
#include "hbapirdd.h"
SELF_ZAP( w ) --> lprfsHost->zap )( w ) )>
Arguments:
Returns:
lprfsHost->zap )( w ) )>
Description:
Examples:
Status:
R
Compliance:
NA
Files:
Header file is hbapirdd.h
See also:
SET ALTERNATE
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Toggle and echos output to an alternate file
Syntax:
SET ALTERNATE to [ADDITIVE]
SET ALTERNATE on | OFF | ()
Arguments:
Name of alternate file.
Logical expression for toggle
Returns:
Description:
This command toggles and output console information to the alternate
file , provided that the command is toggled on or the condition
is set to a logical true (.T.). If does not has a
file extension, .txt will be assumed. The file name may optionally
have a drive letter and/or directory path. If none is specified, the
current drive and directory will be used.
If the ALTERNATE file is created but no ALTERNATE ON command is
issued, nothing will be echoed to the file.
If ADDITIVE clause is used, then the information will be appended
to the existing alternate file. Otherwise, a new file will be created
with the specified name (or an existing one will be overwritten) and
the information will be appended to the file. The default is to create
a new file.
A SET ALTERNATE TO command will close the alternate file
Examples:
SET ALTERNATE TO test.txt
SET ALTERNATE ON
? 'Harbour'
? "is"
? "Power"
SET ALTERNATE TO
SET ALTERNATE OFF
Status:
R
Compliance:
C
Files:
See also:
CLOSE,SET PRINTER,SET CONSOLE,SET()
SET BELL
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Toggle the bell to sound once a GET has been completed.
Syntax:
SET BELL on | OFF | ()
Arguments:
Logical expression for toggle command
Returns:
Description:
This command toggles the bell to sound whenever a character is
entered into the last character position of a GET, or if an invalid
data type is entered into a GET.
If is a logical true (.T.), the bell will be turned
ON; otherwise, the bell will be turned off.
Examples:
SET BELL ON
cDummy := Space( 20 )
@ 3,2 GET cDummy
READ
SET BELL OFF
Status:
R
Compliance:
C
Files:
See also:
SET()
SET CENTURY
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Toggle the century digits in all dates display
Syntax:
SET CENTURY on | OFF | ()
Arguments:
Logical expression for toggle
Returns:
Description:
This command allows the input and display of dates with the century
prefix. It will be in the standart MM/DD/YYYY format unless specified
by the SET DATE command or SET() function. If is a logical
true (.T.), the command will be set on; otherwise, the command will
be set off
Examples:
SET CENTURY ON
? Date()
SET CENTURY OFF
Status:
R
Compliance:
C
Files:
See also:
SET DATE,SET EPOCH,CTOD(),DATE(),DTOC(),SET()
SET CONSOLE
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Toggle the console display
Syntax:
SET CONSOLE ON | off | ()
Arguments:
Logical expression for toggle command
Returns:
Description:
This command turns the screen display either off or on for all
screens display other then direct output via the @...SAY commands
or the <-> DEVOUT() function.
If is a logical true (.T.),the console will be turned
ON; otherwise, the console will be turned off.
Examples:
SET CONSOLE ON
? Date()
SET CONSOLE OFF
? Date()
Status:
R
Compliance:
C
Files:
See also:
SET DEVICE,SET()
SET DATE
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Assigns a date format or chooses a predefined date data set.
Syntax:
SET DATE FORMAT [TO]
SET DATE [TO] [ANSI / BRITISH / FRENCH / GERMAN / ITALIAN / JAPAN / USA / AMERICAN]
Arguments:
Keyword for date format
Returns:
Description:
This command sets the date format for function display purposes.
If specified, may be a customized date format in which the
letters d, m and y may be used to design a date format. The default
is an AMERICAN date format; specifying no parameters will set the
date format to AMERICAN. Below is a table of the various predefined
dates formats.
Syntax Date Format
ANSI yy.mm.dd
BRITISH dd/mm/yy
FRENCH dd/mm/yy
GERMAN dd.mm.yy
ITALIAN dd-mm-yy
JAPAN yy.mm.dd
USA mm-dd-yy
AMERICAN mm/dd/yy
Examples:
SET DATE JAPAN
? Date()
SET DATE GERMAN
? Date()
Status:
R
Compliance:
C
Files:
See also:
SET DATE,SET EPOCH,CTOD(),DATE(),DTOC(),SET()
SET DECIMALS
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Toggle the console display
Syntax:
SET DECIMALS TO []
Arguments:
Number of decimals places
Returns:
Description:
This command establishes the number of decimal places that Harbour
will display in mathematical calculations, functions, memory variables,
and fields. Issuing no parameter with this command will the default
number of decimals to 0. For decimals to be seen, the SET FIXED ON
command must be activated.
Examples:
SET FIXED ON
? 25141251 / 362
SET DECIMALS TO 10
? 214514.214 / 6325
Status:
R
Compliance:
C
Files:
See also:
SET FIXED,SET()
SET DEFAULT
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Establishes the Harbour search drive and directory.
Syntax:
SET DEFAULT TO []
Arguments:
Drive and/or path.
Returns:
Description:
This command changes the drive and directory used for reading and
writing database,index,memory, and alternate files. Specifying no
parameters with this command will default the operation to the
current logged drive and directory.
Examples:
SET DEFAULT TO C:\temp
Status:
R
Compliance:
C
Files:
See also:
SET PATH,CURDIR(),SET()
SET DEVICE
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Directs all @...SAY output to a device.
Syntax:
SET DEVICE TO [printer | SCREEN ]
Arguments:
None.
Returns:
Description:
This command determines whether the output from the @...SAY command
and the DEVPOS() and DEVOUT() function will be displayed on the
printer.
When the device is set to the PRINTER,the SET MARGIN value adjusts
the position of the column values accordingly. Also, an automatic
page eject will be issued when the current printhead position is
less than the last printed row. Finally, if used in conjunction with
the @...GET commands, the values for the GETs will all be ignored.
Examples:
SET DEVICE TO SCREEN
? 25141251 / 362
SET DEVICE TO PRINTER
SET PRINTER TO LPT1
? 214514.214 / 6325
SET PRINTER OFF
SET DEVICE TO SCREEN
Status:
R
Compliance:
C
Files:
See also:
@...SAY,SET PRINTER,SETPRC(),SET()
SET EPOCH
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Specify a base year for interpreting dates
Syntax:
SET EPOCH TO
Arguments:
Base Century.
Returns:
Description:
This command sets the base year value for dates that have only two
digits. The default setting is 1900. Dates between 01/01/0100 and
12/31/2999 are fully supported.
Examples:
SET EPOCH TO 2000
Status:
R
Compliance:
C
Files:
See also:
SET DATE,SET CENTURY,CTOD(),DATE(),DTOC(),SET()
SET FIXED
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Set the number of decimal position to be displayed
Syntax:
SET FIXED on | OFF | ()
Arguments:
Logical expression for toggle
Returns:
Description:
This command activates a system wide fixed placement of decimals
places shown for all numeric outputs. If the value of is
a logical true (.T.), FIXED will be turned ON; otherwise it will be
turned OFF.
When SET DECIMALS OFF is used, the following rules apply to the number
of decimal placed displayed.
Addition Same as operand with the greatest number of decimal digits
Subtraction Same as operand with the greatest number of decimal digits
Multiplication Sum of operand decimal digits
Division Determined by SET DECIMAL TO
Exponential Determined by SET DECIMAL TO
LOG() Determined by SET DECIMAL TO
EXP() Determined by SET DECIMAL TO
SQRT() Determined by SET DECIMAL TO
VAL() Determined by SET DECIMAL TO
Examples:
SET FIXED ON
? 25141251 / 362
SET FIXED OFF
Status:
R
Compliance:
C
Files:
See also:
SET DECIMALS,EXP(),LOG(),SQRT(),VAL(),SET()
SET FUNCTION
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Assign a character string to a function key
Syntax:
SET FUNCTION TO []
Arguments:
is a number in the range 1..40 that represent the
function key to be assigned.
is a character string to set. If is not
specified, the function key is going to be set to NIL releasing by
that any previous Set Function or SETKEY() for that function.
Returns:
Description:
Set Function assign a character string with a function key, when
this function key is pressed, the keyboard is stuffed with this
character string. Set Function has the effect of clearing any
SETKEY() previously set to the same function number and vice versa.
nFunctionKey Key to be set
1 .. 12 F1 .. F12
13 .. 20 Shift-F3 .. Shift-F10
21 .. 30 Ctrl-F1 .. Ctrl-F10
31 .. 40 Alt-F1 .. Alt-F10
SET FUNCTION command is preprocessed into __SetFunction() function
during compile time.
Examples:
// Set F1 with a string
CLS
Set Function 1 to "I Am Lazy" + CHR( 13 )
cTest := SPACE( 20 )
@ 10, 0 SAY "type something or F1 for lazy mode " GET cTest
READ
? cTest
Status:
R
Compliance:
Harbour use 11 and 12 to represent F11 and F12, while CA-Cl*pper use
11 and 12 to represent Shift-F1 and Shift-F2.
Files:
See also:
INKEY(),SETKEY(),__Keyboard()
SET INTENSITY
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Toggles the enhanced display of PROMPT's and GETs.
Syntax:
SET INTENSITY ON | off | ()
Arguments:
Logical expression for toggle command
Returns:
Description:
This command set the field input color and @...PROMPT menu color
to either highlighted (inverse video) or normal color. The default
condition is ON (highlighted).
Examples:
SET INTENSITY ON
Status:
R
Compliance:
C
Files:
See also:
@...GET,@...PROMPT,@...SAY,SET()
SET KEY
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Assign an action block to a key
Syntax:
SET KEY to p] [when ] )
Arguments:
is either a numeric key value, or an array of such values
is an optional code-block to be assigned
is an optional condition code-block
Returns:
Description:
The Set Key Command function is translated to the SetKey() function
witch returns the current code-block assigned to a
key when called with only the key value. If the action block (and
optionally the condition block) are passed, the current block is
returned, and the new code block and condition block are stored.
A group of keys may be assigned the same code block/condition block
by using an array of key values in place on the first parameter.
Examples:
LOCAL bOldF10 := setKey( K_F10, {|| Yahoo() } )
... // some other processing
SET KEY K_F10 TO bOldF10
... // some other processing
bBlock := SetKey( K_SPACE )
IF bBlock != NIL ...
// make F10 exit current get, but only if in a get - ignores other
// wait-states such as menus, achoices, etc...
SetKey( K_F10, {|| GetActive():State := GE_WRITE },;
{|| GetActive() != NIL } )
Status:
R
Compliance:
SET KEY is mostly CA-Cl*pper compliant. The only difference is the
addition of the condition code-block parameter, allowing set-keys to
be conditionally turned off or on. This condition-block cannot be
returned once set - see SetKeyGet()
Files:
See also:
HB_SETKEYSAVE()
SET MESSAGE
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Establishes a message row for @...PROMPT command
Syntax:
SET MESSAGE TO [ [CENTER]]
Arguments:
Row number to display the message
Returns:
Description:
This command is designed to work in conjunction with the MENU TO and
@...PROMPT commands. With this command, a row number between 0 and
MAXROW() may be specified in . This establishes the row on
witch any message associated with an @...PROMPT command will appear.
If the value of is 0, all messages will be suppressed.
All messaged will be left-justifies unless the CENTER clause is
used. In this case, the individual messages in each @...PROMPT command
will be centered at the designated row (unless is 0). All
messages are independent; therefore, the screen area is cleared out
by the centered message will vary based on the length of each
individual message.
Specifying no parameters with this command set the row value to 0,
witch suppresses all messages output.
The British spelling of CENTRE is also supported.
Examples:
See tests/menutest.prg
Status:
R
Compliance:
C
Files:
See also:
SET(),SET WRAP,@...PROMPT,MENU TO
SET PATH
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Specifies a search path for opening files
Syntax:
SET PATH TO []
Arguments:
Search path for files
Returns:
Description:
This command specifies the search path for files required by most
commands and functions not found in the current drive and directory.
This pertains primarily, but not exclusively, to databases, indexes,
and memo files, as well as to memory, labels and reports files. The
search hierarchy is: 1 Current drive and directory, 2 The SET DEFAULT
path; 3 The SET PATH path.
Examples:
SET PATH TO C:\harbour\test
Status:
R
Compliance:
C
Files:
See also:
SET DEFAULT,CURDIR(),SET()
SET PRINTER
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Toggles the printer and controls the printer device
Syntax:
SET PRINTER on | OFF
SET PRINTER ()
SET PRINTER TO [] [ADDITIVE]
Arguments:
Logical condition by which to toggle the printer
A device name or an alternate name
Returns:
Description:
This command can direct all output that is not controlled by the
@...SAY command and the DEVPOS() and DEVOUT() functions to the
printer. If specified,the condition toggles the printer
ON if a logical true (.T.) and OFF if a logical false (.F.). If no
argument is specified in the command, the alternate file (if one
is open) is closed, or the device is reselected and the PRINTER
option is turned OFF.
If a device is specified in , the output will be directed
to that device instead of to the PRINTER. A specified device may be
a literal string or a variable, as long as the variable is enclosed
in parentheses. For a network, do not use a trailing colon when
redirecting to a device.
If an alternate file is specified, becomes the name of a
file that will contain the output. If no file extension is specified
an extension of .prn will be defaulted to.
If the ADDITIVE clause is specified, the information will be appended
to the end of the specified output file. Otherwise, a new file will
be created with the specified name (or an existing file will first
be cleared) and the information will then be appended to the file.
The default is to create a new file.
Examples:
SET PRINTER ON
SET PRINTER TO LPT1
? 25141251 / 362
SET PRINTER .F.
Status:
R
Compliance:
C
Files:
See also:
SET DEVICE, SET CONSOLE, DEVOUT(), SET()
SET WRAP
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Command
Category:
Command
Subcategory:
Environment
Oneliner:
Toggle wrapping the PROMPTs in a menu.
Syntax:
SET WRAP on | OFF | (
Arguments:
Logical expression for toggle
Returns:
Description:
This command toggles the highlighted bars in a @...PROMPT command
to wrap around in a bottom-to-top and top-to-bottom manner. If the
value of the logical expression is a logical false (.F.),
the wrapping mode is set OFF; otherwise,it is set ON.
Examples:
See tests/menutest.prg
Status:
R
Compliance:
C
Files:
See also:
@...PROMPT,MENU TO
SET()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Changes or evaluated environmental settings
Syntax:
Set( [, [, ] ] ) --> xPreviousSetting
Arguments:
Set Number
Any expression to assign a value to the setting
Logical expression
_SET_ALTERNATE |
If enabled, QOUT() and QQOUT() write to the screen and to
a file, provided that a file has been opened or created
with _SET_ALTFILE. If disabled, which is the default,
QOUT() and QQOUT() only write to the screen (and/or to
the PRINTFILE). Defaults to disabled.
_SET_ALTFILE
When set, creates or opens file to write QOUT() and
QQOUT() output to. If is TRUE and the file
already exists, the file is opened and positioned at end
of file. Otherwise, the file is created. If a file is
already opened, it is closed before the new file is
opened or created (even if it is the same file). The
default file extension is ".txt". There is no default
file name. Call with an empty string to close the file.
_SET_AUTOPEN |
TODO: Document
_SET_AUTORDER |
TODO: Document
_SET_AUTOSHARE |
TODO: Document
_SET_BELL |
When enabled, the bell sounds when the last position of
a GET is reached and/or when a GET validation fails.
Disabled by default.
_SET_CANCEL |
When enabled, which is the default, pressing Alt+C or
Ctrl+Break terminates the program. When disabled, both
keystrokes can be read by INKEY(). Note: SET KEY has
precedence over SET CANCEL.
_SET_COLOR
Sets the current color scheme, using color pairs in the
sequence ",,,,
". Each color pair uses the format
"/". The color codes are space
or "N" for black, "B" for blue, "G" for green, "BG" for
Cyan, "R" for red, "RB" for magenta, "GR" for brown, "W"
for white, "N+" for gray, "B+" for bright blue, "G+" for
bright green, "BG+" for bright cyan, "R+" for bright red,
"RB+" for bright magenta, "GR+" for yellow, and "W+" for
bright white. Special codes are "I" for inverse video,
"U" for underline on a monochrome monitor (blue on a
color monitor), and "X" for blank. The default color is
"W/N,N/W,N,N,N/W".
_SET_CONFIRM |
If enabled, an exit key must be pressed to leave a GET.
If disabled, which is the default, typing past the end
will leave a GET.
_SET_CONSOLE |
If enabled, which is the default, all screen output goes
to the screen. When disabled, screen output is suppressed
(Note: This setting does not affect OUTSTD() or OUTERR()).
_SET_CURSOR
If enabled, which is the default, the cursor is displayed
on screen. If disabled, the screen cursor is hidden.
_SET_DATEFORMAT
Sets the default date format for display, date input, and
date conversion. Defaults to American ("mm/dd/yy"). Other
formats include ANSI ("yy.mm.dd"), British ("dd/mm/yy"),
French ("dd/mm/yy"), German ("dd.mm.yy"), Italian
("dd-mm-yy"), Japan ("yy/mm/dd"), and USA ("mm-dd-yy").
SET CENTURY modifies the date format. SET CENTURY ON
replaces the "y"s with "YYYY". SET CENTURY OFF replaces
the "y"s with "YY".
_SET_DEBUG
When set to .t., pressing Alt+D activates the debugger.
When set to .f., which is the default, Alt+D can be read
by INKEY(). (Also affected by AltD(1) and AltD(0))
_SET_DECIMALS
Sets the number of decimal digits to use when displaying
printing numeric values when SET FIXED is ON. Defaults to
2. If SET FIXED is OFF, then SET DECIMALS is only used to
determine the number of decimal digits to use after using
EXP(), LOG(), SQRT(), or division. Other math operations
may adjust the number of decimal digits that the result
will display. Note: This never affects the precision of
a number. Only the display format is affected.
_SET_DEFAULT
Sets the default directory in which to open, create and
check for files. Defaults to current directory (blank).
_SET_DELETED |
If enabled, deleted records will be processed. If
disabled, which is the default, deleted records will
be ignored.
_SET_DELIMCHARS
Sets the GET delimiter characters. Defaults to "::".
_SET_DELIMITERS |
If enabled, GETs are delimited on screen. If disabled,
which is the default, no GET delimiters are used.
_SET_DEVICE
Selects the output device for DEVOUT(). When set to
"PRINTER", all output is sent to the printer device or
file set by _SET_PRINTFILE. When set to anything else,
all output is sent to the screen. Defaults to "SCREEN".
_SET_EOF |
Defaults to FALSE on UN*X, but defaults to TRUE on
everything else. If set to FALSE, then CHR(26) does not
get written when using COPY TO DELIMITED, COPY TO SDF,
or when closing any of the various text files that are
created using various SET values.
[This is a Harbour extension]
_SET_EPOCH
Determines how to handle the conversion of 2-digit years
to 4 digit years. When a 2-digit year is greater than or
equal to the year part of the epoch, the century part of
the epoch is added to the year. When a 2-digit year is
less than the year part of the epoch, the century part
of the epoch is incremented and added to the year. The
default epoch is 1900, which converts all 2-digit years
to 19xx. Example: If the epoch is set to 1950, 2-digit
years in the range from 50 to 99 get converted to 19xx
and 2-digit years in the range 00 to 49 get converted
to 20xx.
_SET_ESCAPE |
When enabled, which is the default, pressing Esc will
exit a READ. When disabled, pressing Esc during a READ
is ignored, unless the Esc key has been assigned to a
function using SET KEY.
_SET_EVENTMASK
Determines which events INKEY() will respond to.
INKEY_MOVE allows mouse movement events. INKEY_LDOWN
allows the left mouse button down click. INKEY_LUP
allows the left mouse button up click. INKEY_RDOWN
allows the right mouse button down click. INKEY_RUP
allows the right mouse button up clock. INKEY_KEYBOARD
allows keyboard keystrokes. INKEY_ALL allows all of the
preceding events. Events may be combined (e.g., using
INKEY_LDOWN + INKEY_RUP will allow left mouse button
down clicks and right mouse button up clicks). The
default is INKEY_KEYBOARD.
_SET_EXACT |
When enabled, all string comparisons other than "=="
exclude trailing spaces when checking for equality.
When disabled, which is the default, all string
comparisons other than "==" treat two strings as
equal if the right hand string is "" or if the right
hand string is shorter than or the same length as the
left hand string and all of the characters in the right
hand string match the corresponding characters in the
left hand string.
_SET_EXCLUSIVE |
When enabled, which is the default, all database files
are opened in exclusive mode. When disabled, all
database files are opened in shared mode. Note: The
EXCLUSIVE and SHARED clauses of the USE command can be
used to override this setting.
_SET_EXIT |
Toggles the use of Uparrow and Dnarrow as READ exit keys.
Specifying true (.T.) enables them as exit keys, and
false (.F.) disables them. Used internally by the
ReadExit() function.
_SET_EXTRA |
QUESTION: What is this for?
It does not affect _SET_EXTRAFILE in CA-Cl*pper!
_SET_EXTRAFILE
When set, creates or opens file to write QOUT() and
QQOUT() output to. If is TRUE and the file
already exists, the file is opened and positioned at end
of file. Otherwise, the file is created. If a file is
already opened, it is closed before the new file is
opened or created (even if it is the same file). The
default file extension is ".prn". There is no default
file name. Call with an empty string to close the file.
_SET_FIXED |
When enabled, all numeric values will be displayed
and printed with the number of decimal digits set
by SET DECIMALS, unless a PICTURE clause is used.
When disabled, which is the default, the number
of decimal digits that are displayed depends upon
a variety of factors. See _SET_DECIMALS for more.
_SET_INSERT |
When enabled, characters typed in a GET or MEMOEDIT
are inserted. When disabled, which is the default,
characters typed in a GET or MEMOEDIT overwrite.
Note: This setting can also be toggled between on and
off by pressing the Insert key during a GET or MEMOEDIT.
_SET_INTENSITY |
When enabled, which is the default, GETs and PROMPTs
are displayed using the enhanced color setting. When
disabled, GETs and PROMPTs are displayed using the
standard color setting.
_SET_LANGUAGE
Specifies the language to be used for Harbour messages.
[This is a Harbour extension]
_SET_MARGIN
Sets the left margin for all printed output. The default
value is 0. Note: PCOL() reflects the printer's column
position including the margin (e.g., SET MARGIN TO 5
followed by DEVPOS(5, 10) makes PCOL() return 15).
_SET_MBLOCKSIZE
TODO: Document
_SET_MCENTER |
If enabled, display PROMPTs centered on the MESSAGE row.
If disabled, which is the default, display PROMPTS at
column position 0 on the MESSAGE row.
_SET_MESSAGE
If set to 0, which is the default, PROMPTs are always
suppressed. Otherwise, PROMPTs are displayed on the
set row. Note: It is not possible to display prompts
on the top-most screen row, because row 0 is reserved
for the SCOREBOARD, if enabled.
_SET_MFILEEXT
TODO: Document
_SET_OPTIMIZE |
TODO: Document
_SET_PATH
Specifies a path of directories to search through to
locate a file that can't be located in the DEFAULT
directory. Defaults to no path (""). Directories must
be separated by a semicolon (e.g., "C:\data;C:\more").
_SET_PRINTER |
If enabled, QOUT() and QQOUT() write to the screen and to
a file, provided that a file has been opened or created
with _SET_ALTFILE. If disabled, which is the default,
QOUT() and QQOUT() only write to the screen (and/or to
the ALTFILE).
_SET_PRINTFILE
When set, creates or opens file to write QOUT(), QQOUT()
and DEVOUT() output to. If is TRUE and the
file already exists, the file is opened and positioned
at end of file. Otherwise, the file is created. If a
file is already opened, it is closed before the new file
is opened or created (even if it is the same file). The
default file extension is ".prn". The default file name
is "PRN", which maps to the default printer device. Call
with an empty string to close the file.
_SET_SCOREBOARD |
When enabled, which is the default, READ and MEMOEDIT
display status messages on screen row 0. When disabled,
READ and MEMOEDIT status messages are suppressed.
_SET_SCROLLBREAK |
QUESTION: What is this flag for?
_SET_SOFTSEEK |
When enabled, a SEEK that fails will position the record
pointer to the first key that is higher than the sought
after key or to LASTREC() + 1 if there is no higher key.
When disabled, which is the default, a SEEK that fails
will position the record pointer to LASTREC()+1.
_SET_STRICTREAD |
TODO: Document
_SET_TYPEAHEAD
Sets the size of the keyboard typeahead buffer. Defaults
to 50. The minimum is 16 and the maximum is 4096.
_SET_UNIQUE |
When enabled, indexes are not allowed to have duplicate
keys. When disabled, indexes are allowed duplicate keys.
_SET_VIDEOMODE
TODO: Document
_SET_WRAP |
When enabled, lightbar menus can be navigated from the
last position to the first and from the first position
to the last. When disabled, which is the default, there
is a hard stop at the first and last positions.
Returns:
SET() The current or previous setting
Description:
Examples:
Status:
Compliance:
C
Files:
Library is rtl
See also:
SETATLIKE()
Lang:
ctstr.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctstr.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Determine scan behaviour in some string functions
Syntax:
SETATLIKE ([] [, <[@]cWildcard>]) --> nOldMode
Arguments:
[] CT_SETATLIKE_EXACT -> characters are compared exactly
CT_SETATLIKE_WILDCARD -> characters are compared using
a wildcard character
The default value is CT_SETATLIKE_EXACT.
[<[@]cWildcard>] determines the character that is subsequently used
as a wildcard character for substring scanning.
The default value is "?".
NEW: If this parameter is passed by reference [@],
the current wildcard character is stored in
.
Returns:
nOldMode old (if nMode is a numeric value) or
current state of the switch
Description:
In the following CT3 functions, strings are compared on a character
base:
ATADJUST() ATNUM() AFTERATNUM()
BEFOREATNUM() ATREPL() NUMAT()
STRDIFF()
With the SETATLIKE function, one can determine when characters are
considered to match within these functions. If CT_SETATLIKE_WILDCARD
is set (e.g. "?"), then "?" matches every other character.
can be one of the following values that are defined
in ct.ch
Definition | Value
----------------------|------
CT_SETATLIKE_EXACT | 0
CT_SETATLIKE_WILDCARD | 1
Examples:
Status:
Ready
Compliance:
This function is fully CT3 compatible, but allows to pass the
second parameter by reference so that the current wildcard character
can be determined.
Files:
Source is ctstr.c, header is ct.ch, library is ct3.
See also:
SETDATE()
Lang:
dattime3.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime3.txt
Template:
Category:
HBCT Date and Time Functions
Subcategory:
Oneliner:
Sets the system date
Syntax:
SETDATE(, []) --> lSet
Arguments:
Designates which date to use to set the system date.
Designates whether the date should also be set in the CMOS-
RAM of an AT. The default is do not write (.F.). Note that in Windows
plataform this adjust is automatic, therefore this parameter is without
efect.
Returns:
SETDATE() RETURNs .T. when the date is successfully set.
Description:
When you use this FUNCTION to set the system date from within your
xHarbour application, all files acquire this date with each write
procedure.
Examples:
Set the system date in each case; but the hardware clock only
on an AT:
dNewDate := SToD( "19910730" )
IF ISAT()
SETDATE( dNewDate, .T. )
ELSE
SETDATE( dNewDate )
ENDIF
Or, more compactly:
SETDATE( dNewDate, ISAT() )
Binary string containing a valid font definition.
Number of a font area where the font must be loaded.
First character code to be loaded.
Number of characters to load.
When .T., the function computes font height automatically.
Returns:
Description:
TODO: Finish documentation
Examples:
Status:
Started
Compliance:
This function is xHarbour libct contrib
Files:
Source is video.c, library is libct.
See also:
SETKEY()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Events
Oneliner:
Assign an action block to a key
Syntax:
SETKEY( [, [, ] ] )
Arguments:
is either a numeric key value, or an array of such values
is an optional code-block to be assigned
is an optional condition code-block
Returns:
Current assigned action-block
Description:
The SetKey() function returns the current code-block assigned to a
key when called with only the key value. If the action block (and
optionally the condition block) are passed, the current block is
returned, and the new code block and condition block are stored.
A group of keys may be assigned the same code block/condition block
by using an array of key values in place on the first parameter.
Examples:
LOCAL bOldF10 := SetKey( K_F10, {|| Yahoo() } )
... // some other processing
SetKey( K_F10, bOldF10 )
... // some other processing
bBlock := SetKey( K_SPACE )
IF bBlock != NIL ...
// make F10 exit current get, but only if in a get - ignores other
// wait-states such as menus, achoices, etc...
SetKey( K_F10, {|| GetActive():State := GE_WRITE },;
{|| GetActive() != NIL } )
Status:
R
Compliance:
SETKEY() is mostly CA-Cl*pper compliant. The only difference is the
addition of the condition code-block parameter, allowing set-keys to
be conditionally turned off or on. This condition-block cannot be
returned once set - see SetKeyGet()
Files:
Library is rtl
See also:
HB_SETKEYSAVE()
SETMODE()
Lang:
setmode.txt
Component:
harbour
Doc. source:
.\doc\en\setmode.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Change the video mode to a specified number of rows and columns
Syntax:
SETMODE( , ) --> lSuccess
Arguments:
is the number of rows for the video mode to set.
is the number of columns for the video mode to set.
Returns:
SETMODE() returns true if the video mode change was successful;
otherwise, it returns false.
Description:
SETMODE() is a function that change the video mode depend on the
video card and monitor combination, to match the number of rows and
columns specified.
Note that there are only a real few combination or rows/cols pairs
that produce the video mode change.
The followings are availables for DOS:
12 rows x 40 columns 12 rows x 80 columns
25 rows x 40 columns 25 rows x 80 columns
28 rows x 40 columns 28 rows x 80 columns
50 rows x 40 columns 43 rows x 80 columns
50 rows x 80 columns
The follow modes are available to Windows
25 rows x 40 columns 25 rows x 80 columns
50 rows x 40 columns 43 rows x 80 columns
50 rows x 80 columns
Some modes only are availables for color and/or VGA monitors.
Any change produced on the screen size is updated in the values
returned by MAXROW() and MAXCOL().
Examples:
// The first example change to a 12 lines of display mode:
IF SETMODE( 12, 40)
? "Hey man are you blind ?"
ELSE
? "Mom bring me my glasses!"
ENDIF
// Next example change to a 50 lines mode:
IF SETMODE( 50, 80)
? "This wonderful mode was successfully set"
ELSE
? "Wait. this monitor are not made in rubber !"
ENDIF
Status:
R
Compliance:
Some of these modes are not availables in CA-Cl*pper
Files:
Source is gtdos.c,gtwin.c
See also:
MAXCOL(),MAXROW()
SETPREC()
Lang:
ctmath.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctmath.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Set precision of math functions
Syntax:
SETPREC () -> cEmptyString
Arguments:
digit count between 1 and 16, defaults to 16
Returns:
cEmptyString this function always returns an empty string
Description:
Be aware that calls to this functions do _NOT_ affect the
calculation precision of the math functions at the moment.
Examples:
Status:
Ready
Compliance:
SETPREC() is compatible with CT3's SETPREC.
Files:
Source is ctmath.c, library is ct3.
See also:
SETTIME()
Lang:
dattime3.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime3.txt
Template:
Category:
HBCT Date and Time Functions
Subcategory:
Oneliner:
Sets the system clock
Syntax:
SETTIME(, []) --> lSet
Arguments:
Designates a character string that contains the time that
is to become the system time.
Designates whether the time should also be set in the
CMOS-RAM of an AT. The default is do not write to CMOS-RAM. Note that in
Windows plataform this adjust is automatic, therefore this parameter is
without efect.
Returns:
The FUNCTION RETURNs .T. when the time is set successfully.
Description:
When you use this FUNCTION to convert the time into the system time from
within your xHarbour application, all files acquire this time with
each write procedure.
Examples:
Set the system time in each case; but the hardware clock only
on an AT:
cNewTime := "10:20:00"
IF ISAT()
SETTIME(cNewTime, .T.)
ELSE
SETTIME(cNewTime)
ENDIF
Or, more compactly:
SETTIME(cNewTime, ISAT())
Status:
Ready
Compliance:
This function is CA-Cl*pper Tools compatible.
Files:
Source is dattime3.c, library is libct.
See also:
SETDATE(),TIMEVALID()
SETTYPEAHEAD()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Sets the typeahead buffer to given size.
Syntax:
SETTYPEAHEAD( ) -->
Arguments:
is a valid typeahead size.
Returns:
The previous state of _SET_TYPEAHEAD
Description:
This function sets the typeahead buffer to a valid given size as is
Set( _SET_TYPEAHEAD ) where used.
Examples:
// Sets typeahead to 12
SetTypeahead( 12 )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
__ACCEPT(),__INPUT()
SIGN()
Lang:
ctmath2.txt
Component:
hbct
Doc. source:
hbct\doc\en\ctmath2.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Sign of a number
Syntax:
SIGN (nNumber) -> nSign
Arguments:
a number
Returns:
sign of
Description:
The function SIGN() determines the sign of .
If is > 0, then SIGN() returns 1
If is < 0, then SIGN() returns -1
If is == 0, then SIGN() returns 0
The function SIN() calculates the sine of an angle whose size is
given in radiants (full angle equals 2*Pi - see DTOR() for angle size
given in degress).
A common geometric interpretation of the SIN() function is the
counterkathede-hypotenuse-ratio of a right-angled triangle.
The function SINH() calculates the hyperbolic sine of the argument.
In analytical mathematics it is defined as 1/2*(exp(nArea)-exp(-nArea)).
A common geometric interpretation of the SINH() function is the
maximum y value of the points in the area with the given size ,
that is bound by the x axis, a straight line through the point of
origin (this one is fixed by the area) and the hyperbola x^2-y^2=1.
This function returns a string consisting of blank spaces.
If the value of is 0, a NULL string ( "" ) will be returned.
This function is useful to declare the length of a character memory
variable.
Examples:
PROCEDURE Main()
LOCAL cBigString
LOCAL cFirst
LOCAL cString := Space( 20 ) // Create an character memory variable
// with length 20
? Len( cString ) // 20
cBigString := space( 100000 ) // create a memory variable with 100000
// blank spaces
? Len( cBigString )
USE tests NEW
cFirst := MakeEmpty( 1 )
? Len( cFirst )
RETURN
FUNCTION MakeEmpty( xField )
LOCAL nRecord
LOCAL xRetValue
IF ! Empty( Alias() )
nRecord := RecNo()
dbgoto( 0 )
IF ValType( xField ) == "C"
xField := AScan( dbstruct(), {| aFields | aFields[ 1 ] == Upper( xfield ) } )
ELSE
DEFAULT xField TO 0
IF xField < 1 .OR. xField > FCount()
xfield := 0
ENDIF
ENDIF
IF !( xfield == 0 )
xRetvalue := FieldGet( xfield )
ENDIF
dbgoto( nrecord )
ENDIF
RETURN xRetvalue
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
PADC(),PADL(),PADR(),REPLICATE()
SQRT()
Lang:
math.txt
Component:
harbour
Doc. source:
.\doc\en\math.txt
Template:
Function
Category:
API
Subcategory:
Math
Oneliner:
Calculates the square root of a number.
Syntax:
SQRT( ) -->
Arguments:
Any numeric value.
Returns:
The square root of .
Description:
This function returns the square root of . The precision
of this evaluation is based solely on the settings of the
SET DECIMAL TO command. Any negative number passed as
will always return a 0.
Examples:
SET DECIMAL TO 5
? SQRT( 632512.62541 )
? SQRT( 845414111.91440 )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ROUND()
STANDARD()
Lang:
color.txt
Component:
hbct
Doc. source:
hbct\doc\en\color.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Select the "STANDARD" color value for output
Syntax:
STANDARD () ->
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
STANDARD() is compatible with CT3's STANDARD()
Files:
Source is color.c, library is libct.
See also:
ENHANCED(),UNSELECTED()
STR()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Convert a numeric expression to a character string.
Syntax:
STR( , [], [] ) --> cNumber
Arguments:
is the numeric expression to be converted to a character
string.
is the length of the character string to return, including
decimal digits, decimal point, and sign.
is the number of decimal places to return.
Returns:
STR() returns formatted as a character string. If the
optional length and decimal arguments are not specified, STR()
returns the character string according to the following rules:
Results of STR() with No Optional Arguments
le>
Expression Return Value Length
Field Variable Field length plus decimals
Expressions/constants Minimum of 10 digits plus decimals
VAL() Minimum of 3 digits
MONTH()/DAY() 3 digits
YEAR() 5 digits
RECNO() 7 digits
Description:
STR() is a numeric conversion function that converts numeric values
to character strings. It is commonly used to concatenate numeric
values to character strings. STR() has applications displaying
numbers, creating codes such as part numbers from numeric values,
and creating index keys that combine numeric and character data.
STR() is like TRANSFORM(), which formats numeric values as character
strings using a mask instead of length and decimal specifications.
The inverse of STR() is VAL(), which converts character numbers to
numerics.
* If is less than the number of whole number digits in
, STR() returns asterisks instead of the number.
* If is less than the number of decimal digits
required for the decimal portion of the returned string, Harbour
rounds the number to the available number of decimal places.
* If is specified but is omitted (no
decimal places), the return value is rounded to an integer.
Evaluate the "Edit (Levensthein) Distance" of two strings
Syntax:
STRDIFF (, , [], [],
[]) ->
Arguments:
string at the "starting point" of the transformation process, default is ""
string at the "end point" of the transformation process, default is ""
penalty points for a replacement of one character, default is 3
penalty points for a deletion of one character, default is 6
penalty points for an insertion of one character, default is 1
Returns:
penalty point sum of all operations needed to transform to
Description:
The STRDIFF() functions calculates the so called "Edit" or "Levensthein" distance of two strings.
This distance is a measure for the number of single character replace/insert/delete operations (so called
"point mutations") required to transform into and its value will be the smallest sum of
the penalty points of the required operations.
Be aware that this function is both quite time - O(len(cString1)*len(cString2)) - and memory consuming -
O((len(cString1)+1)*(len(cString2)+1)*sizeof(int)) - so keep the strings as short as possible.
E.g., on common 32 bit systems (sizeof(int) == 4), calling strdiff() with two strings of 1024 bytes
in length will consume 4 MB of memory. To not impose unneeded restrictions, the function will only check if
(len(cString1)+1)*(len(cString2)+1)*sizeof(int) <= UINT_MAX, although allocing UINT_MAX bytes will not
work on most systems. If this simple check fails, -1 is returned.
Also, be aware that there can be an overflow when the penalty points are summed up: Assuming that the
number of transformation operations is in the order of max(len(cString1),len(cString2)), the penalty point
sum, that is internally stored in an "int" variable, is in the order of
(max(len(cString1),len(cString2))*max(nReplacementPenalty,nDeletionPenalty,nInsertionPentaly).
The STRDIFF() does not do an overflow check due to time performance reasons. Future versions of STRDIFF()
could use a type different to "int" to store the penalty point sum to save memory or to avoid overflows.
The function is aware of the settings done by SETATLIKE(), that means that the wildchar character
is considered equal to ALL characters.
Examples:
? strdiff("ABC", "ADC") // 3, one character replaced
? strdiff("ABC", "AEC") // 3, dito
? strdiff("CBA", "ABC") // 6, two characters replaced
? strdiff("ABC", "AXBC") // 1, one character inserted
? strdiff("AXBC", "ABC") // 6, one character removed
? strdiff("AXBC", "ADC") // 9, one character removed and one replaced
Status:
Ready
Compliance:
STRDIFF() is compatible with CT3's STRDIFF().
Files:
Source is strdiff.c, library is libct.
See also:
SETATLIKE()
StrFormat()
Lang:
ht_str.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_str.txt
Template:
Category:
String Tools
Subcategory:
Oneliner:
Format a string
Syntax:
StrFormat([, [, [, ...]]) --> cString
Arguments:
Holds the mask for the resulting string
Holds the strings to be inserted in the mask
maximum 9 of them can be specified.
Returns:
Return the mask with all the parameters inserted.
Description:
String replacment, can be useful when writing international
apps. You can separate the constant strings from the variable ones.
Each %1 - %9 marks will be replaced with the appropriate parameter
from the parameter list.
Marks can be in any order, and can be duplicated.
You can print "%" character with "%%".
Examples:
StrFormat("Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:")
StrFormat("This is %1 from %2", "Victor", "Hungary")
StrFormat("%2 %1 %2", "Param1", "Param2")
Status:
Done
Compliance:
All platforms
Files:
Library is libmisc
See also:
Strong Typing
Lang:
strotype.txt
Component:
harbour
Doc. source:
.\doc\en\strotype.txt
Template:
Document
Category:
Document
Subcategory:
Compiler
Oneliner:
Compile-Time type checking
Syntax:
Arguments:
Returns:
Description:
Strong Type Checking could also be described as "Compile-Time Type
Checking".
CA-Cl*pper generates a Run-Time Error
("Type Mismatch") at an attempt to perform some operations with
the wrong type of Variable.
Examples:
LOCAL Var1 := "A"
? Var1 * 3 // Error here.
@ Var1, 7 SAY 'Hello' // Error here.
? SubStr( "Hello", Var1 ) // Error here.
The above 3 lines would all result in Run-Time Error, because Var1 is
of type CHARACTER but the above lines used it as if it was of type
NUMERIC.
Using Strong Type Checking, or Compile-Time Type Checking, the above
problem would have been discovered and reported in COMPILE-TIME,
rather than waiting for the inevitable problem to be discovered when
we finally execute the program.
Strong Typed Languages allow the programmer to "tell" the compiler (declare)
what is the type of a each Variable, so that the Compiler in return can warn
the programmer, when ever such Declared (Strong Typed) Variable, is used in
a context which is incompatible with its declared type.
For instance, if we "told" the compiler that Var1 above is of type
CHARACTER (LOCAL Var1 AS CHARACTER) the Harbour Compiler could, in
return, warn us if we attempted to perform the calculation:
Var1 * 3
because the Compiler knows we can't perform a multiplication of a
Character. (we might allow it in some context, but this is beyond
the scope of this discussion). Similarly we would have been warned
when attempting to use Var1 as a Row Number ( @ Var1 ), or as the
2nd operand of the SubStr() function SubStr( "Hello", Var1) ),
because the Compiler knows that these operations require a NUMERIC
rather than CHARACTER type.
The above may save us lots of time, by pointing a problem, we can not
escape, since such code will never perform correctly once executed.
So rather than wait to the testing cycle, for such problems to be
discovered, (and some times even later, after we may have
distributed our applications) instead we may know of such problems
as soon as we type HARBOUR ProgName -w3
Harbour also offers a hybrid mode, where it can report such type
mismatch problems, even without requiring the programmer to declare
the type of variables. This feature, is referred to as Adaptive Type
Checking. The programmer is not required to make any changes in his
code to take advantage of this feature. All of the above 3 errors
would have been reported just as effectively as if the programmer
Strong Typed (declared) Var1. Harbour would have been able to report
such problems at compile time because the assignment Var1 := "A"
implied that Var1 is of type CHARACTER,until it will be assigned
another value. Therefore Harbour will "remember" that Var1 "adapted"
type CHARACTER, and thus the subsequent multiplication Var1 * 3, will
be reported as an error, as soon as you attempt to compile such code.
The nice aspect of this hybrid mode, is that unlike Strong Typed
Variables,you don't have to declare the type, so no code changes
are need, the Type instead is assumed by implication (type of the
assigned value). The other benefit, is that it is completely OK to
assign a new value of different type, any time, to such undeclared
(variant) variable. As soon as we assign a new type, the Compiler
will than protect us from using the Variable in an incompatible
context, since the variable "adapted" this type as soon as we
assigned a value which implies a type.
While Adapted Type Checking may be fairly effective in reporting many
common mistakes, to take full benefits of such Compile-Time checking,
it is recommended to do declare the Type of Variables, when ever
possible.
The Harbour Strong Type features, also allows the declaration of the
expected parameters (including optionals) of User Defined Functions,
as well as their return Type. Similarly, you may declare the Type of
any Class Variables, Methods, and Methods Parameters.
Examples:
Status:
Compliance:
Files:
See also:
STRSWAP()
Lang:
strswap.txt
Component:
hbct
Doc. source:
hbct\doc\en\strswap.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Swap the contents of two strings
Syntax:
STRSWAP (<[@]cString1>, <[@]cString2>) -> cString
Arguments:
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
STRSWAP() is compatible with CT3's STRSWAP().
Files:
Source is strswap.c, library is libct.
See also:
STRTRAN()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Translate substring value with a main string
Syntax:
STRTRAN( , , [], [],
[] ) --> cReturn
Arguments:
The main string to search
The string to locate in the main string
The string to replace the The first occurrence to be replaced
Number of occurrence to replace
Returns:
Formated string
Description:
This function searches for any occurrence of in
and replaces it with . If is not specified, a
NULL byte will replace .
If is used, its value defines the first occurrence to be
replaced. The default value is 1. Additionally, if used, the value of
tell the function how many occurrences of
in are to the replaced. The default of is
all occurrences.
Examples:
? STRTRAN( "Harbour Power", " ", " " ) // Harbour Power
// Harbour Power The future of xBase
? STRTRAN( "Harbour Power The Future of xBase", " ", " " ,, 2 )
Status:
R
Compliance:
C
Files:
Libraty is rtl
See also:
SUBSTR(),AT()
STRZERO()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Convert a numeric expression to a character string, zero padded.
Syntax:
STRZERO( , [], [] ) --> cNumber
Arguments:
is the numeric expression to be converted to a character
string.
is the length of the character string to return, including
decimal digits, decimal point, and sign.
is the number of decimal places to return.
Returns:
STRZERO() returns formatted as a character string. If the
optional length and decimal arguments are not specified, STRZERO()
returns the character string according to the following rules:
Results of STRZERO() with No Optional Arguments
Expression Return Value Length
Field Variable Field length plus decimals
Expressions/constants Minimum of 10 digits plus decimals
VAL() Minimum of 3 digits
MONTH()/DAY() 3 digits
YEAR() 5 digits
RECNO() 7 digits
Description:
STRZERO() is a numeric conversion function that converts numeric
values to character strings. It is commonly used to concatenate
numeric values to character strings. STRZERO() has applications
displaying numbers, creating codes such as part numbers from numeric
values, and creating index keys that combine numeric and character
data.
STRZERO() is like TRANSFORM(), which formats numeric values as
character strings using a mask instead of length and decimal
specifications.
The inverse of STRZERO() is VAL(), which converts character numbers
to numerics.
* If is less than the number of whole number digits in
, STR() returns asterisks instead of the number.
* If is less than the number of decimal digits
required for the decimal portion of the returned string, Harbour
rounds the number to the available number of decimal places.
* If is specified but is omitted (no
decimal places), the return value is rounded to an integer.
The STRZERO() function was part of the CA-Cl*pper samples.
Character expression to be parsed
Start position
Number of characters to return
Returns:
Substring of evaluation
Description:
This functions returns a character string formed from ,
starting at the position of and continuing on for a
length of characters. If is not specified, the value
will be all remaining characters from the position of .
The value of may be negative. If it is, the direction of
operation is reversed from a default of left-to-right to right-to-left
for the number of characters specified in . If the number of
characters from to the end of the string is less than
the rest are ignored.
string indicating new line,
default is the string returned by
hb_eol()
character indicating a tab stop,
default is chr(9)
.T., if the soft-CR used by MEMOEDIT()
should be ignored as a newline indicator,
default is .F. (functions uses chr(141))
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
TABEXPAND() is compatible with CT3's TABEXPAND(), but there are
three new parameters for a better fine control of the function's
behaviour.
Files:
Source is tab.c, library is libct.
See also:
TABPACK()
TABPACK()
Lang:
tab.txt
Component:
hbct
Doc. source:
hbct\doc\en\tab.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Pack fill characters to appropriate tab characters
Syntax:
TABPACK (, [], [],
[], [],
[]) -> cPackedString
Arguments:
string indicating new line,
default is the string returned by
hb_eol()
character indicating a tab stop,
default is chr(9)
.T., if the soft-CR used by MEMOEDIT()
should be ignored as a newline indicator,
default is .F. (functions uses chr(141))
Returns:
Description:
TODO: add documentation
Examples:
Status:
Started
Compliance:
TABPACK() is compatible with CT3's TABPACK(), but there are
three new parameters for a better fine control of the function's
behaviour.
Files:
Source is tab.c, library is libct.
See also:
TABEXPAND()
TAN()
Lang:
trig.txt
Component:
hbct
Doc. source:
hbct\doc\en\trig.txt
Template:
Category:
CT3 math functions
Subcategory:
Oneliner:
Tangent of the argument
Syntax:
TAN (nRadiant) -> nTangent
Arguments:
an angle size given in radiants
Returns:
the tangent of
Description:
The function TAN() calculates the tangent of an angle whose size is
given in radiants (full angle equals 2*Pi - see DTOR() for angle size
given in degress).
A common geometric interpretation of the TAN() function is the
counterkathede-ankathede-ratio of a right-angled triangle, or,
tan(x) = sin(x)/cos(x).
Create a new TBrowse object to be used with database file
Syntax:
TBrowseDB( [], [], [], [] ) --> oBrowse
Arguments:
coordinate for top row display.
coordinate for left column display.
coordinate for bottom row display.
coordinate for right column display.
Returns:
TBrowseDB() return new TBrowse object with the specified coordinate
and a default :SkipBlock, :GoTopBlock and :GoBottomBlock to browse
a database file.
Description:
TBrowseDB() is a quick way to create a TBrowse object along with
the minimal support needed to browse a database. Note that the
returned TBrowse object contain no TBColumn objects and you need
to add column for each field by your self.
Examples:
for a good example, look at the source code for BROWSE() function
at src/rtl/browse.prg
Top Row
Top Left Column
Bottom Row
Bottom Right Column
Returns:
An new Browse Object
Description:
This function set up a browsing window at top-left coordinates of
, to bottom-right coordinates of ,.
To browse Database files use TBROWSEDB() function insted.
Examples:
See tests/testbrw.prg
Status:
S
Compliance:
This functions is Compatible with CA-Cl*pper 5.2. The applykey() and
Setkey() methods are only visible if HB_COMPAT_C53 is defined.
Files:
Library is rtl
See also:
TBROWSENEW(),TBCOLUMNNEW()
TERM/2013
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Create error
Syntax:
Arguments:
Returns:
Description:
The specified file cannot be created due some OS error.
Examples:
SET, SET ALTERNATE TO
Status:
Compliance:
C
Files:
See also:
TFileRead()
Lang:
ht_class.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_class.txt
Template:
Category:
Harbour Tools
Subcategory:
Oneliner:
Read a file one line at a time
Syntax:
oFile := TFileRead():New( [, ] )
Arguments:
is the required name of the file to be read.
is the optional size to use when reading from the file.
The default value is 4096 and the allowed range is 1 through 65535.
Any value outside of this range causes the default value to be used.
Returns:
An instance of the File Reader class
Description:
TFileRead() is used to access a file one line at a time. You must
specify the name of the file when an instance of the class is created.
The class data should be considered private to the class.
The class methods are as follows:
New() Creates a new instance of the TFileRead class.
Open([]) Opens the file for reading. The optional nFlags
parameter can use any of the FOPEN() flags from
fileio.ch. The default is FO_READ + FO_SHARED.
Calling this method when the file is already
open causes the next ReadLine() to start over
from the beginning of the file.
Close() Closes the file.
ReadLine() Returns one line from the file, stripping the
newline characters. The following sequences are
treated as one newline: 1) CR CR LF; 2) CR LF;
3) LF; and 4) CR. Note: LF CR is 2 newlines.
Name() Returns the name of the file.
IsOpen() Returns .T. if the file is open.
MoreToRead() Returns .T. if there are more lines to be read
(think of it as an inverse EOF function).
Error() Returns .T. if an error has occurred.
ErrorNo() Returns the current error code.
ErrorMsg([]) Returns a formatted error message.
Examples:
#ifdef __HARBOUR__
#define NEW_LINE CHR( 10 )
#else
#define NEW_LINE CHR( 13 ) + CHR( 10 )
#endif
#include "fileio.ch"
PROCEDURE Main( cFile )
LOCAL oFile := TFileRead():New( cFile )
oFile:Open()
IF oFile:Error()
QOUT( oFile:ErrorMsg( "FileRead: " ) )
ELSE
WHILE oFile:MoreToRead()
OUTSTD( oFile:ReadLine() )
OUTSTD( NEW_LINE )
END WHILE
oFile:Close()
END IF
QUIT
Status:
R
Compliance:
This is a new Harbour Tools class
Files:
Library is libmisc
See also:
TClass()
The Garbage Collector
Lang:
garbage.txt
Component:
harbour
Doc. source:
.\doc\en\garbage.txt
Template:
Document
Category:
Document
Subcategory:
Oneliner:
Readme for Harbour Garbage Collect Feature
Syntax:
Arguments:
Returns:
Description:
The garbage collector uses the following logic:
- first collect all memory allocations that can cause garbage;
- next scan all variables if these memory blocks are still referenced.
Notice that only arrays, objects and codeblocks are collected because
these are the only datatypes that can cause self-references (a[1]:=a)
or circular references (a[1]:=b; b[1]:=c; c[1]:=a) that cannot be
properly deallocated by simple reference counting.
Since all variables in harbour are stored inside some available tables
(the eval stack, memvars table and array of static variables) then checking
if the reference is still alive is quite easy and doesn't require any
special treatment during memory allocation. Additionaly the garbage
collector is scanning some internal data used by harbour objects
implementation that also stores some values that can contain memory
references. These data are used to initialize class instance variables
and are stored in class shared variables.
In special cases when the value of a harbour variable is stored internally
in some static area (at C or assembler level), the garbage collector will
be not able to scan such values since it doesn't know their location. This
could cause some memory blocks to be released prematurely. To prevent the
premature deallocation of such memory blocks the static data have to store
a pointer to the value created with hb_itemNew() function.
Example:
static HB_ITEM s_item; // this item can be released by the GC
static PHB_ITEM pItem; // this item will be maintained correctly
pItem = hb_itemNew( hb_param(1, IT_BLOCK) );
However, scanning of all variables can be a time consuming operation. It
requires that all allocated arrays have to be traversed through all their
elements to find more arrays. Also all codeblocks are scanned for detached
local variables they are referencing. For this reason, looking for unreferenced
memory blocks is performed during the idle states.
The idle state is a state when there is no real application code
executed. For example, the user code is stopped for 0.1 of a second
during INKEY(0.1) - Harbour is checking the keyboard only
during this time. It leaves however quite enough time for
many other background tasks. One such background task can be looking
for unreferenced memory blocks.
Allocating memory
-----------------
The garbage collector collects memory blocks allocated with hb_gcAlloc()
function calls. Memory allocated by hb_gcAlloc() should be released with
hb_gcFree() function.
The garbage collecting
----------------------
During scanning of unreferenced memory the GC is using a mark & sweep
algorithm. This is done in three steps:
1) mark all memory blocks allocated by the GC with unused flag;
2) sweep (scan) all known places and clear unused flag for memory
blocks that are referenced there;
3) finalize collecting by deallocation of all memory blocks that are
still marked as unused and that are not locked.
To speed things up, the mark step is simplified by swapping the meaning
of the unused flag. After deallocation of unused blocks all still alive
memory blocks are marked with the same 'used' flag so we can reverse
the meaning of this flag to 'unused' state in the next collecting.
All new or unlocked memory blocks are automatically marked as 'unused'
using the current flag, which assures that all memory blocks are marked
with the same flag before the sweep step will start.
See hb_gcCollectAll() and hb_gcItemRef()
Calling the garbage collector from harbour code
-----------------------------------------------
The garbage collector can be called directly from the harbour code.
This is usefull in situations where there is no idle states available
or the application is working in the loop with no user interaction
and there is many memory allocations.
See HB_GCALL() for explanation of how to call this function from your
harbour code.
HBGD is basically a wrapper of Thomas Boutell's GD Library version 2.0.33.
GD Library is a powerfull graphic library very usefull expecially under CGI environment.
HBGD actually contains almost all GD functions, more a set of functions that extends original
library and a set of classes that make easier to work with this library.
Thomas Boutell's GD library actually supports these graphic formats:
PNG, JPEG, GIF, Animated GIF, GD, GD2, WBMP, XBM, XPM
WBMP is Wireless Bitmap, not Windows Bitmap, and it is used for WAP. It is a B&W bitmap.
HBGD actually supports PNG, JPEG, GIF, GD, WBMP
The other Animated GIF, GD2, XBM and XPM are not wrapped actually.
Using this library you can, as a little example:
- create an image in memory, true color or with a 256 colors palette;
- load and save an image of above formats and convert it to another supported format;
- draw dots, lines, dashed lines, polygons, rectangles, arcs, circles and ellipses;
- fill with colors;
- draw with brushes;
- check a point or part or full image with a lot of query functions;
- draw characters and words with internal fonts or using truetype fonts;
- write strings on a base line or on a circle line and with any angle degree;
- copy, resize and rotate part or full image;
and, over this, some functions to clone, crop, zoom, rotate outside and inside.
The prefix for all functions is GD (i.e. gdImageCreate() )
You can use directly all API functions or TGD class.
NOTE: Not all functions are wrapped.
Examples:
Status:
Compliance:
Files:
See also:
Alphabetical list of functions, Categorized list of functions, GDImage Class, GDChart Class.
The idle states
Lang:
idle.txt
Component:
harbour
Doc. source:
.\doc\en\idle.txt
Template:
Document
Category:
Document
Subcategory:
Oneliner:
Read me file for Idle States
Syntax:
Arguments:
Returns:
Description:
The idle state is the state of the harbour virtual machine when it
waits for the user input from the keyboard or the mouse. The idle
state is entered during INKEY() calls currently. All applications
that don't use INKEY() function call can signal the idle states with
the call of HB_IDLESTATE() function (or hb_idleState() on C level).
During idle states the virtual machine calls the garbage collector and
it can call user defined actions (background tasks). It also releases
the CPU time slices for some poor platforms that are not smart enough
(Windows NT).
For defining the background tasks see the HB_IDLEADD() and HB_IDLEDEL()
functions.
For direct call for background actions see HB_IDLESTATE() function.
For signaling the idle state from C code see the hb_idleState()
API function.
Examples:
Status:
Compliance:
Files:
See also:
HB_IDLEADD(),HB_IDLEDEL()
THtml()
Lang:
ht_doc.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_doc.txt
Template:
Category:
Harbour Tools
Subcategory:
Oneliner:
Html Class
Syntax:
oHtml:=THtml():New() --> oHtm
Arguments:
Name of the Html file to create
Returns:
An instance of the THtml Class
Description:
THtml() is a class that creates an .html file of the same
name you pass to the constructor.
The class methods are as follows:
New() Create a new instance of the THtml class
Close() Close the created file
WriteTitle() Write the file title
WritePar() Writes a paragraph
WriteParBold() Same as WritePar(), but the text is bold
WriteLink(,) Write a link to another topic
WriteText() Write any text
Examples:
FUNCTION MAIN()
LOCAL oHtm
oHtm := THTML():New( "www\harbour.html" )
oHtm:WriteTitle( "Harbour Reference Guide" )
oHtm:WritePar( "HARBOUR" )
oHtm:WriteLink( "OverView" )
oHtm:WriteLink( "License" )
oHtm:WriteLink( "http://www.gnu.org/copyleft/gpl" )
oHtm:WritePar( "See the Links Above" )
oHtm:Close()
RETURN Nil
r>
Status:
R
Compliance:
This is a new Harbour Tools class
Files:
See also:
TCLASS()
TIME()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Returns the system time as a string
Syntax:
TIME() --> cTime
Arguments:
None
Returns:
Character string representing time
Description:
This function returns the system time represented as a character
expression in the format of HH:MM:SS
Examples:
? Time()
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
DATE(),SECONDS()
TIMEVALID()
Lang:
dattime3.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime3.txt
Template:
Category:
HBCT Date and Time Functions
Subcategory:
Oneliner:
Determines whether a specIFied time is valid
Syntax:
TIMEVALID() --> lValid
Arguments:
Designates a character string that contains the time to
test.
Returns:
TIMEVALID() RETURNs .T. when is a valid time; or .F. when
is an invalid time.
Description:
With input that requires time manipulation, writing your own UDF to
check time inputs was unavoidable up to now. TIMEVALID() permits
Complete checking of a time designation. You can use this FUNCTION
effectively with a VALID clause within a READ mask.
Note
Note the format for time designations. There must always be
two digits for hours, minutes, seconds, and hundredths; otherwise,
the time it is regarded as invalid. Valid examples are "12",
"12:59", "12:59:59", and "12:59:59:99". By contrast, invalid
examples are "24", "12:60", or "12:1", and/or "12:". IF you work
with time strings that are not completely filled and that you need to
check with TIMEVALID(), then they must be TRIMmed prior to the use of
TIMEVALID() (see following Examples).
Examples:
Using the VALID clause with TRIM, all valid times are
accepted, even IF no seconds or minutes are specIFied:
cBegin := SPACE(11)
@ 5, 10 SAY "Please input time for beginning work:";
GET cBegin VALID TIMEVALID(TRIM(cBegin))
READ
Using a VALID clause without TRIM, hours and minutes must be
specified, so that TIMEVALID() can confirm a valid time:
cBegin := SPACE(5)
@ 5, 10 SAY "Please input time for beginning work:";
GET cBegin VALID TIMEVALID(cBegin)
READ
Status:
Ready
Compliance:
This function is CA-Cl*pper Tools compatible.
Files:
Source is dattime3.c, library is libct.
See also:
SETTIME()
TNortonGuide()
Lang:
ht_doc.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_doc.txt
Template:
Category:
Harbour Tools
Subcategory:
Oneliner:
Norton Guide Class
Syntax:
oNg:=TNortonGuide():New() --> oNg
Arguments:
Name of the Ng Source file to create
Returns:
An instance of the TNortonGuide Class
Description:
TNortonGuide() is a class that creates the Norton Guide Source
Code of the same name you pass to the constructor.
The class methods are as follows:
New() Create an instance of the TNortonGuide class
Close() Close the created file
WriteTitle(,) Write the file title
WritePar() Write a paragraph
WriteParBold() Same as WritePar(), but the text is bold
WriteLink() Write a link to another topic
Examples:
FUNCTION MAIN()
LOCAL oNg
oNg := TNortonGuide():New( "ngi\harbour.ngi" )
oNg:WriteTitle( "Harbour Reference Guide" )
oNg:WritePar( "HARBOUR" )
oNg:WriteLink( "OverView" )
oNg:WriteLink( "License" )
oNg:WritePar( "See the Links Above" )
oNg:Close()
RETURN Nil
is the processed string
[] is a list of characters separating the tokens
in
Default: chr(0)+chr(9)+chr(10)+chr(13)+chr(26)+
chr(32)+chr(32)+chr(138)+chr(141)+
",.;:!\?/\\<>()#&%+-*"
[] specifies the count of the token that
should be extracted
Default: last token
[] specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty token
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
[<@cPreTokenSep>] If given by reference, the tokenizer before
the actual token will be stored
[<@cPostTokenSep>] If given by reference, the tokenizer after
the actual token will be stored
Returns:
the token specified by the parameters given above
Description:
The TOKEN() function extracts the th token from the
string . In the course of this, the tokens in the
string are separated by the character(s) specified in .
The function may also extract empty tokens, if you specify a skip
width other than zero.
Be aware of the new 5th and 6th parameter there the TOKEN() function
stores the tokenizing character before and after the extracted token.
Therefore, additional calls to the TOKENSEP() function are not
necessary.
TOKEN() is compatible with CT3's TOKEN, but two additional
parameters have been added there the TOKEN() function can store
the tokenizers before and after the current token.
.T., if TOKENAT() should return
the position of the separator character
BEHIND the token.
Default: .F., return start position of a token.
a token number
<@cTokenEnvironment> a token environment
Returns:
Description:
The TOKENAT() function is used to retrieve the start and end position
of the tokens in a token environment. Note however that the position of
last character of a token is given by tokenat (.T.)-1 !!
If the 2nd parameter, is given, TOKENAT() returns the
positions of the th token. Otherwise
the token pointed to by the TE counter, i.e. the token that will
be retrieved by TOKENNEXT() _NEXT_ is used.
If the parameter <@cTokenEnvironment> is supplied (must be by
reference), the information from this token environment is used,
otherwise the global TE is used.
Examples:
Status:
Ready
Compliance:
TOKENAT() is compatible with CTIII's TOKENAT(),
but there are two additional parameters featuring local token
environments and optional access to tokens.
Check whether additional tokens are available with TOKENNEXT()
Syntax:
TOKENEND ([<@cTokenEnvironment>]) -> lTokenEnd
Arguments:
<@cTokenEnvironment> a token environment
Returns:
.T., if additional tokens are available
Description:
The TOKENEND() function can be used to check whether the next
call to TOKENNEXT() would return a new token. This can not be
decided with TOKENNEXT() alone, since an empty token cannot be
distinguished from a "no more" tokens.
If the parameter <@cTokenEnvironment> is supplied (must be by
reference), the information from this token environment is used,
otherwise the global TE is used.
With a combination of TOKENEND() and TOKENNEXT(), all tokens from a
string can be retrieved successivly (see example).
Examples:
tokeninit ("a.b.c.d", ".", 1) // initialize global TE
do while (!tokenend())
? tokennext ("a.b.c.d") // get all tokens successivly
enddo
Status:
Ready
Compliance:
TOKENEND() is compatible with CTIII's TOKENEND(),
but there are is an additional parameter featuring local token environments.
.T., if global token environment is successfully released
Description:
The TOKENEXIT() function releases the memory associated with the
global token environment. One should use it for every tokeninit()
using the global TE. Additionally, TOKENEXIT() is implicitly called
from CTEXIT() to free the memory at library shutdown.
Examples:
tokeninit (cString) // initialize a TE
do while (!tokenend())
? tokennext (cString) // get all tokens successivly
enddo
? tokennext (cString, 3) // get the 3rd token, counter will remain the same
tokenexit() // free the memory used for the global TE
Status:
Ready
Compliance:
TOKENEXIT() is a new function in Harbour's CTIII library.
<[@]cString> is the processed string
is a list of characters separating the tokens
in
Default: chr(0)+chr(9)+chr(10)+chr(13)+chr(26)+
chr(32)+chr(32)+chr(138)+chr(141)+
",.;:!\?/\\<>()#&%+-*"
specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty token
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
<@cTokenEnvironment> is a token environment stored in a binary
encoded string
Returns:
success of the initialization
Description:
The TOKENINIT() function initializes a token environment. A token
environment is the information about how a string is to be tokenized.
This information is created in the process of tokenization of the
string - equal to the one used in the TOKEN() function
with the help of the and parameters.
This token environment can be very useful when large strings have
to be tokenized since the tokenization has to take place only once
whereas the TOKEN() function must always start the tokenizing process
from scratch.
Unlike CTIII, this function provides two mechanisms of storing the
resulting token environment. If a variable is passed by reference
as 4th parameter, the token environment is stored in this variable,
otherwise the global token environment is used. Do not modify the
token environment string directly !
Additionally, a counter is stored in the token environment, so that
the tokens can successivly be obtained. This counter is first set to 1.
When the TOKENINIT() function is called without a string a tokenize,
the counter of either the global environment or the environment given
by reference in the 4th parameter is rewind to 1.
Additionally, unlike CTIII, tokeninit() does not need the string
to be passed by reference, since one must provide the
string in calls to TOKENNEXT() again.
Examples:
tokeninit (cString) // tokenize the string with default
// rules and store the token environment globally
// and eventually delete an old global TE
tokeninit (@cString) // no difference in result, but eventually faster,
// since the string must not be copied
tokeninit() // rewind counter of global TE to 1
tokeninit ("1,2,3",",",1) // tokenize constant string, store in global TE
tokeninit (cString,,1,@cTE1) // tokenize cString and store TE in
// cTE1 only without overriding global TE
tokeninit (cString,,1,cTE1) // tokenize cString and store TE in
// GLOBAL TE since 4th parameter is
// not given by reference !!!
tokeninit (,,,@cTE1) // set counter in TE stored in cTE1 to 1
Status:
Ready
Compliance:
TOKENINIT() is compatible with CTIII's TOKENINIT(),
but there is an additional parameter featuring local token environments.
<[@]cString> is the processed string
[] is a list of characters separating the tokens
in
Default: chr(0)+chr(9)+chr(10)+chr(13)+chr(26)+
chr(32)+chr(32)+chr(138)+chr(141)+
",.;:!\?/\\<>()#&%+-*"
[] specifies the number of tokens that
should be processed
Default: all tokens
[] specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty token
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
Returns:
the string with the lowercased tokens
Description:
The TOKENLOWER() function changes the first letter of tokens in
to lower case. To do this, it uses the same tokenizing mechanism
as the token() function. If TOKENLOWER() extracts a token that starts
with a letter, this letter will be changed to lower case.
You can omit the return value of this function by setting the CSETREF()
switch to .T., but you must then pass by reference to get
the result.
Examples:
? tokenlower("Hello, World, here I am!") // "hello, world, here i am!"
? tokenlower("Hello, World, here I am!",,3) // "hello, world, here I am!"
? tokenlower("Hello, World, here I am!",",",3) // "hello, World, here I am!"
? tokenlower("Hello, World, here I am!"," W") // "hello, World, here i am!"
Status:
Ready
Compliance:
TOKENLOWER() is compatible with CT3's TOKENLOWER(),
but a new 4th parameter, has been added for
synchronization with the the other token functions.
<[@]cString> the processed string
a token number
<@cTokenEnvironment> a token environment
Returns:
a token from
Description:
With TOKENNEXT(), the tokens determined with the TOKENINIT() functions
can be retrieved. To do this, TOKENNEXT() uses the information stored
in either the global token environment or the local one supplied by
. Note that, is supplied, this 3rd parameter has
always to be passed by reference.
If the 2nd parameter, is given, TOKENNEXT() simply returns
the th token without manipulating the TE counter. Otherwise
the token pointed to by the TE counter is returned and the counter
is incremented by one. Like this, a simple loop with TOKENEND() can
be used to retrieve all tokens of a string successivly.
Note that does not have to be the same used in TOKENINIT(),
so that one can do a "correlational tokenization", i.e. tokenize a string
as if it was another! E.G. using TOKENINIT() with the string
"AA,BBB" but calling TOKENNEXT() with "CCCEE" would
give first "CC" and then "EE" (because "CCCEE" is not long enough).
Examples:
// default behavhiour
tokeninit (cString) // initialize a TE
do while (!tokenend())
? tokennext (cString) // get all tokens successivly
enddo
? tokennext (cString, 3) // get the 3rd token, counter will remain the same
tokenexit() // free the memory used for the global TE
Status:
Ready
Compliance:
TOKENNEXT() is compatible with CTIII's TOKENNEXT(),
but there are two additional parameters featuring local token
environments and optional access to tokens.
The TOKENNUM() function can be used to retrieve the total number
of tokens in a token environment.
If the parameter <@cTokenEnvironment> is supplied (must be by
reference), the information from this token environment is used,
otherwise the global TE is used.
Examples:
tokeninit ("a.b.c.d", ".", 1) // initialize global TE
? tokennum() // --> 4
Status:
Ready
Compliance:
TOKENNUM() is a new function in Harbour's CTIII library.
Retrieves the token separators of the last token() call
Syntax:
TOKENSEP ([]) -> cSeparator
Arguments:
[] if set to .T., the token separator BEHIND the token
retrieved from the token() call will be returned.
Default: .F., returns the separator BEFORE the token
Returns:
Depending on the setting of , the separating character of the
the token retrieved from the last token() call will be returned.
These separating characters can now also be retrieved with the token()
function.
Description:
When one does extract tokens from a string with the token() function,
one might be interested in the separator characters that have been
used to extract a specific token. To get this information you can
either use the TOKENSEP() function after each token() call, or
use the new 5th and 6th parameter of the token() function.
<[@]cString> is the processed string
[] is a list of characters separating the tokens
in
Default: chr(0)+chr(9)+chr(10)+chr(13)+chr(26)+
chr(32)+chr(32)+chr(138)+chr(141)+
",.;:!\?/\\<>()#&%+-*"
[] specifies the number of tokens that
should be processed
Default: all tokens
[] specifies the maximum number of successive
tokenizing characters that are combined as
ONE token stop, e.g. specifying 1 can
yield to empty token
Default: 0, any number of successive tokenizing
characters are combined as ONE token stop
Returns:
the string with the uppercased tokens
Description:
The TOKENUPPER() function changes the first letter of tokens in
to upper case. To do this, it uses the same tokenizing mechanism
as the token() function. If TOKENUPPER() extracts a token that starts
with a letter, this letter will be changed to upper case.
You can omit the return value of this function by setting the CSETREF()
switch to .T., but you must then pass by reference to get
the result.
Examples:
? tokenupper("Hello, world, here I am!") // "Hello, World, Here I Am!"
? tokenupper("Hello, world, here I am!",,3) // "Hello, World, Here I am!"
? tokenupper("Hello, world, here I am!",",",3) // "Hello, world, here I am!"
? tokenupper("Hello, world, here I am!"," w") // "Hello, wOrld, Here I Am!"
Status:
Ready
Compliance:
TOKENUPPER() is compatible with CT3's TOKENUPPER(),
but a new 4th parameter, has been added for
synchronization with the the other token functions.
Sound a tone with a specified frequency and duration.
Syntax:
TONE( , ) --> NIL
Arguments:
A non-negative numeric value that specifies the
frequency of the tone in hertz.
A positive numeric value which specifies the duration
of the tone in 1/18 of a second units.
Returns:
TONE() always returns NIL.
Description:
TONE() is a sound function that could be used to irritate the end
user, his or her dog, and the surrounding neighborhood. The frequency
is limited to the range 0 to 32767 Hz.
Examples:
IF lOk // Good Sound
TONE( 500, 1 )
TONE( 4000, 1 )
TONE( 2500, 1 )
ELSE // Bad Sound
TONE( 300, 1 )
TONE( 499, 5 )
TONE( 700, 5 )
ENDIF
Status:
S
Compliance:
C
Files:
Library is rtl
See also:
CHR(),SET BELL
TOOLS/4001
Lang:
subcodes.txt
Component:
harbour
Doc. source:
.\doc\en\subcodes.txt
Template:
Run time error
Category:
Run time errors
Subcategory:
Oneliner:
Invalid argument passed to function
Syntax:
Arguments:
Returns:
Description:
The second arguments passed to a function is not a string.
Examples:
ISLEAPYEAR
Status:
Compliance:
H
Files:
See also:
TOs2()
Lang:
ht_doc.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_doc.txt
Template:
Category:
Harbour Tools
Subcategory:
Oneliner:
OS/2 Documentation Class
Syntax:
oNg:=TOs2():New() --> oOs2
Arguments:
Name of the IPF Source file to create
Returns:
An instance of the TOs2 Class
Description:
TOs2() is a class that creates the OS/2 IPF Source
of the same name you pass to the constructor.
The class methods are as follows:
New() Create a new instance of the TOs2 class
Close() Close the created file
WriteTitle(,) Write the file title
WritePar() Write a paragraph
WriteParBold() Same as WritePar(), but the text is bold
WriteLink() Write a link to another topic
ScanLink() Scan the aLinkRef array for a valid topic
DosToOs2Text() Convert a Dos string to a OS/2 String
Examples:
FUNCTION MAIN()
LOCAL oNg
oNg := TOs2():New( "ngi\harbour.ngi" )
oNg:WriteTitle( "Harbour Reference Guide" )
oNg:WritePar( "HARBOUR" )
oNg:WriteLink( "OverView" )
oNg:WriteLink( "License" )
oNg:WritePar( "See the Links Above" )
oNg:Close()
RETURN Nil
Status:
R
Compliance:
This is a new Harbour Tools class
Files:
See also:
TNortonGuide()
TRANSFORM()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Formats a value based on a specific picture template.
Syntax:
TRANSFORM( , ) --> cFormatted
Arguments:
Any expression to be formated.
Character string with picture template
Returns:
Formatted expression in character format
Description:
This function returns in the format of the picture
expression passed to the function as .
Their are two components that can make up : a function
string and a template string. Function strings are those functions
that globally tell what the format of should be. These
functions are represented by a single character precede by the
@ symbol.
There are a couple of rules to follow when using function strings
and template strings:
- First, a single space must fall between the function template
and the template string if they are used in conjunction with
one another.
- Second, if both components make up the value of , the
function string must precede the template string. Otherwise, the
function string may appear with out the template string and
vice versa.
The table below shows the possible function strings available with
the TRANSFORM() function.
@B Left justify the string within the format.
@C Issue a CR after format is numbers are positive.
@D Put dates in SET DATE format.
@E Put dates in BRITISH format.
@L Make a zero padded string out of the number.
@R Insert non template characters.
@X Issue a DB after format is numbers are negative.
@Z Display any zero as blank spaces.
@( Quotes around negative numbers
@! Convert alpha characters to uppercased format.
The second part of consists of the format string. Each
character in the string may be formatted based on using the follow
characters as template markers for the string.
A,N,X,9,# Any data type
L Shows logical as "T" or "F"
Y Shows logical as "Y" or "N"
! Convert to uppercase
$ Dollar sing in place of leading spaces in numeric expression
* Asterisks in place of leading spaces in numeric expression
, Commas position
. Decimal point position
Examples:
LOCAL cString := "This is harbour"
LOCAL nNumber := 9923.34
LOCAL nNumber1 := -95842.00
LOCAL lValue := .T.
LOCAL dDate := DATE()
? "working with String"
? "Current String is", cString
? "All uppercased", TRANSFORM( cString, "@!" )
? "Date is", ddate
? "Date is ", TRANSFORM( ddate, "@D" )
? TRANSFORM( nNumber, "@L 99999999" ) // "009923.34"
? TRANSFORM( 0 , "@L 9999" ) // "0000"
Status:
R
Compliance:
The @L function template is a FoxPro/Xbase++ Extension
Files:
Library is rtl
See also:
@...SAY,DEVOUTPICT()
TRIM()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Remove trailing spaces from a string.
Syntax:
TRIM( ) --> cString
Arguments:
Any character expression
Returns:
A formatted string with out any blank spaced.
Description:
This function returns the value of with any trailing blank
removed.
This function is identical to RTRIM() and the opposite of LTRIM().
Together with LTRIM(), this function equated to the ALLTRIM()
function.
TRtf() is a class that creates the RTF Documentation Source
Code of the same name you pass to the constructor.
The class methods are as follows:
New() Create a new instance of the TRtf class
Close() Close the create file
WriteTitle(,) Write the file title
WritePar() Write a paragraph
WriteParBold() Same as WritePar(), but the text is bold
WriteLink() Write a link to another topic
WriteHeader() Write the RTF header
EndPar() Write the end paragraph delimiter
Examples:
FUNCTION MAIN()
LOCAL oRtf
oRtf := TRtf():New( "rtf\harbour.rtf" )
oRtf:WriteHeader()
oRtf:WriteTitle( "Harbour Reference Guide" )
oRtf:WritePar( "HARBOUR" ):Endpar()
oRtf:WriteLink( "OverView" )
oRtf:WriteLink( "License" )
oRtf:WritePar( "See the Links Above" ):EndPar()
oRtf:Close()
RETURN Nil
Status:
R
Compliance:
This is a new Harbour Tools class
Files:
See also:
TNortonGuide()
TTroff()
Lang:
ht_doc.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\ht_doc.txt
Template:
Category:
Harbour Tools
Subcategory:
Oneliner:
Troff Class
Syntax:
oTroff:=TTrof():New() --> oTrf
Arguments:
Name of the Troff file to create
Returns:
instance of the TTroff Class
Description:
TTroff() is a class that creates the TROFF Documentation Source
Code of the same name you pass to the constructor.
The class methods are as follows:
New() Create a new instance of the THtml class
Close() Close the created file
WriteTitle(,) Write the file title
WritePar() Write a paragraph
WriteParBold() Same as WritePar(), but the text is bold
WriteLink() Write a link to another topic
WriteText() Writes text without formating
Examples:
FUNCTION MAIN()
LOCAL oTroff
oTroff := TTroff():New( "tr\harbour.ngi" )
oTroff:WriteTitle( "Harbour Reference Guide" )
oTroff:WritePar( "HARBOUR" )
oTroff:WriteLink( "OverView" )
oTroff:WriteLink( "License" )
oTroff:WritePar( "See the Links Above" )
oTroff:Close()
RETURN Nil
Status:
R
Compliance:
This is a new Harbour Tools class
Files:
See also:
TNortonGuide()
TYPE
Lang:
file.txt
Component:
harbour
Doc. source:
.\doc\en\file.txt
Template:
Command
Category:
Command
Subcategory:
FileSys
Oneliner:
Show the content of a file on the console, printer or file
Syntax:
TYPE [TO PRINTER] [TO FILE ]
Arguments:
is a name of the file to display. If the file have an
extension, it must be specified (there is no default value).
It can be specified as literal file name or as a character
expression enclosed in parentheses.
TO PRINTER is an optional keyword that specifies that the output
should go to both the screen and printer.
TO FILE copy the source also to a file. If no
extension is given (.txt) is added to the output file name.
can be specified as literal file name or as a character
expression enclosed in parentheses.
Returns:
Description:
TYPE command type the content of a text file on the screen
with an option to send this information also to the printer or to
an alternate file. The file is displayed as is without any headings
or formatting.
If contain no path, TYPE try to find the file first in the
SET DEFAULT directory and then in search all of the SET PATH
directories. If can not be found a run-time error occur.
If contain no path it is created in the SET DEFAULT
directory.
Use SET CONSOLE OFF to suppress screen output.
You can pause the output using Ctrl-S, press any key to resume.
Examples:
The following examples assume a file name mytext.dat exist in all
specified paths, a run-time error would displayed if it does not
// display mytext.dat file on screen
TYPE mytext.dat
// display mytext.dat file on screen and printer
TYPE mytext.dat TO PRINTER
// display mytext.dat file on printer only
SET CONSOLE OFF
TYPE mytext.dat TO PRINTER
SET CONSOLE ON
// display mytext.dat file on screen and into a file myreport.txt
TYPE mytext.dat TO FILE MyReport
a string indicating the type of the passed expression.
Meaning
"A" Array
"B" Block
"C" Character (string)
"D" Date
"L" Logical
"M" Memo
"N" Numeric
"O" Object
"P" Pointer
"S" Symbol
"U" NIL, local or static variable, or not linked-in function
"UE" syntax error in the expression or invalid arguments
"UI" function with non-reserved name was requested
Description:
This function returns a string which represents the data type
of the argument. The argument can be any valid Harbour expression.
If there is a syntax error in passed expression then "UE" is returned.
If there is a call for any non-reserved Harbour function then "UI"
is returned (in other words there is no call for passed UDF function
during a data type determination - this is CA-Cl*pper compatible
behavior). Additionally if requested user defined function is not
linked into executable then "U" is returned.
The data type of expression is checked by invoking a macro compiler
and by evaluation of generated code (if there is no syntax errors).
This causes that TYPE() cannot determine a type of local or static
variables - only symbols visible at runtime can be checked.
Notice the subtle difference between TYPE and VALTYPE functions.
VALTYPE() function doesn't call a macro compiler - it simply checks
the type of passed argument of any type. TYPE() requires a string
argument with a valid Harbour expression - the data type of this
expression is returned.
Examples:
? TYPE( "{ 1, 2 }" ) // prints "A"
? TYPE( "iif( .T., SubStr( "TYPE", 2, 1 ), .F. )" ) // prints "C"
? TYPE( "At( "OK", MyUDF() ) > 0" ) // prints "UI"
? TYPE( "{ 1, 2 }[ 5 ]" ) // prints "UE"
//--------------------------------------------------------
LOCAL c
PRIVATE a := "A", b := "B"
? TYPE( "a + b + c" ) // prints: "U" ('C' variable is a local one)
//--------------------------------------------------------
LOCAL cFilter := Space( 60 )
ACCEPT "Enter filter expression:" TO cFilter
IF TYPE( cFilter ) $ "CDLMN"
// this is a valid expression
SET FILTER TO &cFilter
ENDIF
Status:
R
Compliance:
- Incompatibility with CA-Cl*pper:
In the following code:
PRIVATE lCond := 0
? TYPE( "iof( lCond, 'true', MyUDF() )" )
CA-Cl*pper will print "UE" - in Harbour the output will be "UI"
- If "UI" is returned then the syntax of the expression is
correct. However invalid arguments can be passed to
function/procedure that will cause runtime errors during
evaluation of expression.
- Harbour supports two new types (Pointer and Symbol) which does
not exists in CA-Cl*pper.
Files:
Library is rtl
See also:
VALTYPE()
U2BIN()
Lang:
binnum.txt
Component:
harbour
Doc. source:
.\doc\en\binnum.txt
Template:
Function
Category:
API
Subcategory:
Conversion
Oneliner:
Convert Harbour numeric into unsigned long encoded bytes
Syntax:
U2BIN( ) --> cBuffer
Arguments:
is a numeric value to convert (decimal digits are ignored).
Returns:
U2BIN() return four bytes character string that contain 32 bit
encoded unsigned long integer (least significant byte first).
Description:
U2BIN() is one of the low level binary conversion functions, those
functions convert between Harbour numeric and a character
representation of numeric value. U2BIN() take a numeric integer
value and convert it into four bytes of encoded 32 bit unsigned long
integer.
You might ask what is the need for such functions, well, first of
all it allow you to read/write information from/to a binary file
(like extracting information from DBF header), it is also a useful
way to share information from source other than Harbour (C for
instance).
U2BIN() is the opposite of BIN2U()
UNSELECTED() is compatible with CT3's UNSELECTED()
Files:
Source is color.c, library is libct.
See also:
ENHANCED(),STANDARD()
UNTEXTWIN()
Lang:
screen1.txt
Component:
hbct
Doc. source:
hbct\doc\en\screen1.txt
Template:
Category:
CT3 video functions
Subcategory:
Oneliner:
Syntax:
UNTEXTWIN(, , , ,
,
[],
[]) --> cNull
Arguments:
Designates the line for the upper-left corner of the
area.
Designates the column for the upper-left corner of
the area.
Designates the line for the bottom-right corner of
the area.
Designates the line for the bottom-right column of
the area.
Replaces each
character within the window, with the exception of those within the
range of and
.
Designates the beginning of
the bracketed area. The character can be number in the range of 0 to
255, or the character string type. The default value is 176.
Designates the end of the bracketed
area. The character can be number in the range of 0 to 255 or the
character string type. The default value is 223.
Returns:
Returns a null string.
Description:
Replaces an area of characters from a region of the screen
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is screen1.c, library is libct.
See also:
UPPER()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Converts a character expression to uppercase format
Syntax:
UPPER( ) --> cUpperString
Arguments:
Any character expression.
Returns:
Uppercased value of
Description:
This function converts all alpha characters in to upper
case values and returns that formatted character expression.
Checks whether a database is in use in a work area
Syntax:
USED() --> lDbfOpen
Arguments:
(This function has no arguments)
Returns:
True is a database is Used;otherwise False
Description:
This function returns a logical true (.T.) if a database file is in
USE in the current or designated work area. If no alias is specified
along with this function , it will default to the currently selected
work area.
Examples:
USE tests NEW
USE names NEW
? USED() // .T.
? TESTS->( USED() ) //.T.
CLOSE
? USED() // .F.
SELECT tests
? USED() //.T.
Status:
R
Compliance:
C
Files:
Library is rdd
See also:
ALIAS(), SELECT()
VAL()
Lang:
string.txt
Component:
harbour
Doc. source:
.\doc\en\string.txt
Template:
Function
Category:
API
Subcategory:
Strings
Oneliner:
Convert a number from a character type to numeric
Syntax:
VAL( ) --> nNumber
Arguments:
Any valid character string of numbers.
Returns:
The numeric value of
Description:
This function converts any number previously defined as an character
expression into a numeric expression.
This functions is the oppose of the STR() function.
Examples:
? VAL( "31421" ) // 31421
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
STR(),TRANSFORM()
VALPOS()
Lang:
ascpos.txt
Component:
hbct
Doc. source:
hbct\doc\en\ascpos.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Numerical value of a character at a certain position
Syntax:
VALPOS (, []) --> nDigitValue
Arguments:
is the processed string
[] is an optional position within
Default: last position in
Returns:
the numerical value of the character at the specified
position
Description:
The VALPOS() function returns the numerical value of the character that
can be found at the position in . If no digit
can be found at this position or if
is larger than the length of , 0 is returned.
a character indicating the type of the passed expression.
Meaning
"A" Array
"B" Block
"C" Character (string)
"D" Date
"L" Logical
"M" Memo
"N" Numeric
"O" Object
"P" Pointer
"S" Symbol
"U" NIL
Description:
This function returns one character which represents the data type
of the argument.
Examples:
See Test(s)
Status:
R
Compliance:
VALTYPE() is CA-Cl*pper compliant, with the addition of the new
Harbour types: Pointer and Symbol.
Files:
Library is rtl
See also:
TYPE()
VERSION()
Lang:
misc.txt
Component:
harbour
Doc. source:
.\doc\en\misc.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Returns the HARBOUR Version or the Harbour/Compiler Version.
Syntax:
VERSION() -->
Arguments:
None
Returns:
String containing the Harbour Version
Description:
This function returns the current Harbour Version.
Examples:
? VERSION() // "Harbour Terminal: Standard stream console"
Status:
S
Compliance:
C
Files:
src/rtl/version.c
Library is rtl
See also:
OS()
VGAPALETTE()
Lang:
video.txt
Component:
hbct
Doc. source:
hbct\doc\en\video.txt
Template:
Category:
HBCT video functions
Subcategory:
Oneliner:
Changes VGA palette colors
Syntax:
VGAPALETTE([, [, ,
lValid
Arguments:
- the color to change in CA-Cl*pper color notation or
as a number from 0 to 15.
, , and specify the palette
settings for the respective portions in the range from 0 to 63.
If no RGB value is specified, the palette register is reset to
its default value (currently unsupported).
If the function is called without parameters, the palette registers for
all colors are reset to their default values (currently unsupported).
Convert Harbour numeric into unsigned short encoded bytes
Syntax:
W2BIN( ) --> cBuffer
Arguments:
is a numeric value to convert (decimal digits are ignored).
Returns:
W2BIN() return two bytes character string that contain 16 bit
encoded unsigned short integer (least significant byte first).
Description:
W2BIN() is one of the low level binary conversion functions, those
functions convert between Harbour numeric and a character
representation of numeric value. W2BIN() take a numeric integer
value and convert it into two bytes of encoded 16 bit unsigned short
integer.
You might ask what is the need for such functions, well, first of
all it allow you to read/write information from/to a binary file
(like extracting information from DBF header), it is also a useful
way to share information from source other than Harbour (C for
instance).
W2BIN() is the opposite of BIN2W()
Pauses a specified time in increments of 1/100 seconds
Syntax:
WAITPERIOD([]) --> lNotElapsed
Arguments:
Designates the waiting period at initialization in
1/100ths of seconds. Values from 1 to 8, 640, 000 (one day) are
possible.
Returns:
WAITPERIOD() returns .T. , if the time span designated at initialization
has not elapsed.
Description:
This function sets a time span for a xHarbour DO WHILE loop to run.
The function must initialize prior to the loop, since you must specify
the parameter in 1/100th seconds. Subsequently, the function
can be implemented without a parameter for additional loop conditions.
It returns .T., as long as the designated time span has not yet run out.
Note
The function notes the status of the internal timer at
initialization. From that point on, the initialization should always
precede the respective DO WHILE; otherwise, the time delay is
incorrect. The passing of midnight (the time resets to the 0 value)
is taken into account.
Examples:
Run a loop for 5 seconds:
WAITPERIOD(500) // Initialization, 5 seconds
DO WHILE .AND. .AND. WAITPERIOD()
*...
ENDDO
Status:
Ready
Compliance:
WAITPERIOD() is Clipper Tools compatible.
Files:
Source is dattime3.c, library is libct.
See also:
WEEK()
Lang:
dattime2.txt
Component:
hbct
Doc. source:
hbct\doc\en\dattime2.txt
Template:
Category:
CT3 date and time functions
Subcategory:
Oneliner:
Returns the calendar week a number
Syntax:
WEEK ([][, ]) -> nWeek
Arguments:
Returns:
Description:
Returns the calendar week a number. If no date is specified,
the system date is used. An empty date viz ctod(" / / ")
returns 0.
If is .T., week() will calculate the "simple week number", defined by
- week #1 starts on January, 1st
- week #(n+1) starts seven days after start of week #n
If is .F. (default), the ISO8601 week number, defined by
- weeks start on mondays
- week #1 is the one that includes January, 4
will be calculated
TODO: add further documentation
Examples:
Status:
Started
Compliance:
WEEK() is compatible with CT3's WEEK().
Files:
Source is dattime2.prg, library is libct.
See also:
WORD()
Lang:
binnum.txt
Component:
harbour
Doc. source:
.\doc\en\binnum.txt
Template:
Function
Category:
API
Subcategory:
Conversion
Oneliner:
Converts double to integer values.
Syntax:
WORD( ) -->
Arguments:
is a numeric double value.
Returns:
WORD() return an integer in the range +-32767
Description:
This function converts double values to integers to use
within the CALL command
Examples:
Status:
R
Compliance:
The CA-Cl*pper NG states that WORD() will only work when used in CALL
commands parameter list, otherwise it will return NIL, in Harbour
it will work anywhere.
Files:
Library is rtl
See also:
CALL
WORDONE()
Lang:
charone.txt
Component:
hbct
Doc. source:
hbct\doc\en\charone.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Reduce multiple occurences of a double character to one
Syntax:
WORDONE ([,] ) -> cReducedString
Arguments:
[] specifies the double characters the multiple
occurences of which should be reduced to one
Default: All characters.
specifies the processed string
Returns:
the string with the reduced occurences
Description:
The WORDONE() function reduces multiple occurences of double characters in
to a single one. It is important to note that the multiple
occurences must occur directly one behind the other.
Intersectional set of two strings based on double characters
Syntax:
WORDONLY (, ) -> cReducedString
Arguments:
specifies the double characters that must
not be deleted in .
is the string that should be processed
Returns:
A string with all double characters deleted
but those specified in .
Description:
The WORDONLY() function calculates the intersectional set of two
strings based on double characters. To do this, it deletes all double
characters from that do not appear in .
WORDREM() is a new function available only in Harbour's CT3.
Files:
Source is charonly.c, library is ct3.
See also:
CHARONLY CHARREM() WORDREM()
WORDREPL()
Lang:
wordrepl.txt
Component:
hbct
Doc. source:
hbct\doc\en\wordrepl.txt
Template:
Category:
CT3 string functions
Subcategory:
Oneliner:
Replacement of double characters
Syntax:
WORDREPL (, <[@]cString>,
, []) -> cString
Arguments:
is a string of double characters
that should be replaced
<[@]cString> is the processed string
is a string of double characters that
replace the one of
[] sets the replacement method (see description)
Default: .F.
Returns:
cString the processed string
Description:
The WORDREPL() takes the double characters of
one after the other and searches for them in .
For set to .F., this search is successful, if the double
character sequence in starts at an odd position or at any
position, if is set to .T.
If this happens, the double character sequence will be replaced with
the corresponding double character sequence of .
If is shorter than
the last double sequence of is used for
the "rest" of . Note that the last double
character sequence in "AABBC" is "BB" in this context !!
After the replacement the function restarts the search in
BEHIND the replacement if the CSETATMUPA() switch is turned off, or
BEHIND the first character of the replacement if the switch is turned on.
(see examples for this !)
One can omit the return value of this function by setting the CSETREF()
to .T., but one must then pass by reference to get a result.
<[@]cString> is the string that should be processed
[] specifies whether an additional swap should be
done within the double characters
Default: .F., no additional swap
Returns:
a string where neighbouring double characters are
swapped
Description:
The WORDSWAP() function loops through in steps of four
characters and exchanges the double characters from the first and
second position with the one from the third and forth position.
Additionally the function can perform a swap of the both char of
each double character.
By setting the CSETREF() switch to .T., one can omit the return value
of this functin, but one must then pass by reference.
WORDTOCHAR() is compatible with CT3's WORDTOCHAR().
Files:
Source is wordtoch.c, library is libct.
See also:
CSETATMUPA(),CHARREPL(),WORDREPL()
WOY()
Lang:
dates2.txt
Component:
hbmisc
Doc. source:
hbmisc\doc\en\dates2.txt
Template:
Category:
Date
Subcategory:
Oneliner:
Gets the week number of the year.
Syntax:
WOY( , ) --> nWeek
Arguments:
A valid date.
Returns:
The week number
Flag that indicates if is in ISO format.
Description:
This function returns the week number of the year for a given date.
It returns the week number in ISO format ( range 0 - 52, by default
or passing TRUE as second parameter) or 1 - 52 if lIso is FALSE.
Designate an expression of some of the following data
type: NUMBER, CHARACTER, DATE, LOGICAL.
Returns:
XTOC() return a string with the representation of data type of
expValue.
Description:
Each data type always returns a string with a particular fixed length:
-----------------------------------------------------------
Data Type Result Length Similar function
-----------------------------------------------------------
Numeric sizeof( DOUBLE ) FTOC()
Logical 1
Date 8 DTOS()
String Unchanged
-----------------------------------------------------------
TODO: add documentation
Examples:
Status:
Started
Compliance:
Files:
Source is misc1.c, library is libct.
See also:
CTOF(), FTOC()
xxx()
Lang:
adsfuncs.txt
Component:
rddads
Doc. source:
rddads\doc\en\adsfuncs.txt
Template:
Category:
Advantage Database RDD
Subcategory:
Oneliner:
xxx
Syntax:
xxx( ) --> lPriorSetting
Arguments:
xxx
xxx
Returns:
Description:
See ace.hlp for full details about the Advantage Database Server.
ADSRightsCheck() is a Get/Set function for the "rights checking" mode.
Examples:
Status:
R
Compliance:
Harbour extension
Files:
Library is RddAds
Header is ads.ch
See also:
xxx()
YEAR()
Lang:
datetime.txt
Component:
harbour
Doc. source:
.\doc\en\datetime.txt
Template:
Function
Category:
API
Subcategory:
Date/Time
Oneliner:
Converts the year portion of a date into a numeric value
Syntax:
YEAR() --> nYear
Arguments:
Any valid date expression
Returns:
The year portion of the date.
Description:
This function returns the numeric value for the year in .
This value will always be a four-digit number and is not affected
by the setting of the SET CENTURY and SET DATE commands. Addition
ally, an empty date expression passed to this function will yield
a zero value.
Examples:
? Year( Date() )
? Year( SToD( "32510125" ) )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
DAY(),MONTH()
ZAP
Lang:
rddmisc.txt
Component:
harbour
Doc. source:
.\doc\en\rddmisc.txt
Template:
Command
Category:
Command
Subcategory:
Database
Oneliner:
Remove all records from the current database file
Syntax:
ZAP
Arguments:
(This command has no arguments)
Returns:
Description:
This command removes all of the records from the database in the
current work area. This operation also updates any index file in
use at the time of this operation. In addition, this command removes
all items within an associated memo file.
In a network enviroment, any file that is about to be ZAPped must
be used exclusively.
Examples:
USE tests NEW INDEX tests
ZAP
USE
Status:
R
Compliance:
C
Files:
See also:
DELETE,PACK,USE
_bcmp()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_bcmp -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
memcmp()
_bcopy()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_bcopy -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
memcpy()
_bmove()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_bmove -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
memmove()
_bset()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_bset -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
memset()
_errGetDescription()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetDescription -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetDescription()
_errGetFileName()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetFileName -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetFileName()
_errGetFlags()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetFlags -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetFlags()
_errGetGenCode()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetGenCode -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetGenCode()
_errGetOperation()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetOperation -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetOperation()
_errGetOsCode()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetOsCode -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetOsCode()
_errGetSeverity()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetSeverity -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetSeverity()
_errGetSubCode()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetSubCode -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetSubCode()
_errGetSubSystem()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetSubSystem -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetSubSystem()
_errGetTries()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errGetTries -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errGetTries()
_errLaunch()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errLaunch -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errLaunch()
_errNew()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errNew -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errNew()
_errPutDescription()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutDescription -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutDescription()
_errPutFileName()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutFileName -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutFileName()
_errPutFlags()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutFlags -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutFlags()
_errPutGenCode()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutGenCode -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutGenCode()
_errPutOperation()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutOperation -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutOperation()
_errPutOsCode()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutOsCode -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutOsCode()
_errPutSeverity()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutSeverity -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutSeverity()
_errPutSubCode()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutSubCode -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutSubCode()
_errPutSubSystem()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutSubSystem -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutSubSystem()
_errPutTries()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errPutTries -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errPutTries()
_errRelease()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Error
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "error.api"
_errRelease -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is error.api
See also:
hb_errRelease()
_evalLaunch()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_evalLaunch -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_evalLaunch()
_evalNew()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_evalNew -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_evalNew()
_evalPutParam()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_evalPutParam -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_evalPutParam()
_evalRelease()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_evalRelease -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_evalRelease()
_exmgrab()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Fixed memory
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "fm.api"
_exmgrab -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is fm.api
See also:
hb_xgrab()
_fsChDir()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsChDir -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsChDir()
_fsChDrv()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsChDrv -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsChDrv()
_fsClose()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsClose -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsClose()
_fsCommit()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsCommit -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsCommit()
_fsCreate()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsCreate -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsCreate()
_fsCurDir()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsCurDir -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsCurDir()
_fsCurDrv()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsCurDrv -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsCurDrv()
_fsDelete()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsDelete -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsDelete()
_fsError()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsError -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsError()
_fsExtOpen()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsExtOpen -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsExtOpen()
_fsIsDrv()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsIsDrv -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsIsDrv()
_fsLock()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsLock -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsLock()
_fsMkDir()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsMkDir -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsMkDir()
_fsOpen()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsOpen -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsOpen()
_fsRead()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsRead -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsRead()
_fsRename()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsRename -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsRename()
_fsRmDir()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsRmDir -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsRmDir()
_fsSeek()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsSeek -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsSeek()
_fsWrite()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
FileSys
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "filesys.api"
_fsWrite -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is filesys.api
See also:
hb_fsWrite()
_gtBeginWrite()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtBeginWrite -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtBeginWrite()
_gtBox()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtBox -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtBox()
_gtColorSelect()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtColorSelect -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtColorSelect()
_gtDispBegin()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtDispBegin -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtDispBegin()
_gtDispCount()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtDispCount -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtDispCount()
_gtDispEnd()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtDispEnd -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtDispEnd()
_gtEndWrite()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtEndWrite -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtEndWrite()
_gtExit()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtExit -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtExit()
_gtFlushCursor()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtFlushCursor -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtFlushCursor()
_gtGetColor()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtGetColor -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtGetColor()
_gtGetColorStr()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtGetColorStr -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtGetColorStr()
_gtGetCursor()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtGetCursor -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtGetCursor()
_gtGetPos()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtGetPos -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtGetPos()
_gtInit()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtInit -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtInit()
_gtIsColor()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtIsColor -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtIsColor()
_gtMaxCol()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtMaxCol -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtMaxCol()
_gtMaxRow()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtMaxRow -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtMaxRow()
_gtModalRead()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtModalRead -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtModalRead()
_gtPostExt()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtPostExt -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtPostExt()
_gtPreExt()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtPreExt -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtPreExt()
_gtRectSize()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtRectSize -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtRectSize()
_gtRepChar()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtRepChar -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtRepChar()
_gtRest()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtRest -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtRest()
_gtSave()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSave -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSave()
_gtScrDim()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtScrDim -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtScrDim()
_gtScroll()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtScroll -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtScroll()
_gtSetBlink()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSetBlink -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSetBlink()
_gtSetBorder()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSetBorder -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSetBorder()
_gtSetColor()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSetColor -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSetColor()
_gtSetColorStr()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSetColorStr -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSetColorStr()
_gtSetCursor()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSetCursor -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSetCursor()
_gtSetMode()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSetMode -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSetMode()
_gtSetPos()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSetPos -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSetPos()
_gtSetSnowFlag()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtSetSnowFlag -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtSetSnowFlag()
_gtWApp()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWApp -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWApp()
_gtWCreate()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWCreate -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWCreate()
_gtWCurrent()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWCurrent -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWCurrent()
_gtWDestroy()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWDestroy -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWDestroy()
_gtWFlash()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWFlash -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWFlash()
_gtWPos()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWPos -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWPos()
_gtWrite()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWrite -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWrite()
_gtWriteAt()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWriteAt -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWriteAt()
_gtWriteCon()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWriteCon -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWriteCon()
_gtWVis()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Terminal
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "gt.api"
_gtWVis -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is gt.api
See also:
hb_gtWVis()
_itemArrayGet()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemArrayGet -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemArrayGet()
_itemArrayNew()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemArrayNew -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemArrayNew()
_itemArrayPut()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemArrayPut -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemArrayPut()
_itemNew()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemNew -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemNew()
_itemParam()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemParam -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemParam()
_itemRelease()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemRelease -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemRelease()
_itemReturn()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemReturn -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemReturn()
_itemSize()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemSize -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemSize()
_itemType()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Item
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "item.api"
_itemType -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is item.api
See also:
hb_itemType()
_parc()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parc -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parc()
_parclen()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parclen -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parclen()
_parcsiz()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parcsiz -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parcsiz()
_pards()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_pards -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_pards()
_parinfa()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parinfa -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parinfa()
_parinfo()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parinfo -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parinfo()
_parl()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parl -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parl()
_parnd()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parnd -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parnd()
_parni()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parni -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parni()
_parnl()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_parnl -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_parnl()
_pcount()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_pcount -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_pcount()
_ret()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_ret -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_ret()
_reta()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_reta -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_reta()
_retc()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_retc -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_retc()
_retclen()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_retclen -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_retclen()
_retds()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_retds -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_retds()
_retl()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_retl -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_retl()
_retnd()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_retnd -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_retnd()
_retni()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_retni -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_retni()
_retnl()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_retnl -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_retnl()
_storc()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_storc -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_storc()
_storclen()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_storclen -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_storclen()
_stords()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_stords -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_stords()
_storl()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_storl -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_storl()
_stornd()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_stornd -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_stornd()
_storni()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_storni -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_storni()
_stornl()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Extend
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "extend.api"
_stornl -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is extend.api
See also:
hb_stornl()
_tchdir()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tchdir -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsChDir()
_tchdrv()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tchdrv -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsChDrv()
_tclose()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tclose -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsClose()
_tcommit()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tcommit -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsCommit()
_tcreat()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tcreat -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsCreate()
_tcurdir()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tcurdir -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsCurDir()
_tcurdrv()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tcurdrv -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsCurDrv()
_tdevraw()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tdevraw -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsSetDevRaw()
_terror()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_terror -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsError()
_tisdevice()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tisdevice -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsIsDevice()
_tisdrv()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tisdrv -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsIsDrv()
_tlock()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tlock -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsLock()
_tlseek()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tlseek -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsSeek()
_tmkdir()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tmkdir -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsMkDir()
_topen()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_topen -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsOpen()
_tread()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tread -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsRead()
_trename()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_trename -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsRename()
_trmdir()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_trmdir -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsRmDir()
_tunlink()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_tunlink -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsDelete()
_twrite()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Undocumented
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "hbundoc.api"
_twrite -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is hbundoc.api
See also:
hb_fsWrite()
_xalloc()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Fixed memory
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "fm.api"
_xalloc -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is fm.api
See also:
hb_xalloc()
_xfree()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Fixed memory
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "fm.api"
_xfree -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is fm.api
See also:
hb_xfree()
_xgrab()
Lang:
hb_compa.txt
Component:
harbour
Doc. source:
.\doc\en\hb_compa.txt
Template:
Function
Category:
C level API compatability
Subcategory:
Fixed memory
Oneliner:
Syntax:
C Prototype (macro replacement)
#include "fm.api"
_xgrab -->
Arguments:
Returns:
Description:
Examples:
Status:
R
Compliance:
Files:
Header file is fm.api
See also:
hb_xgrab()
__AtPrompt()
Lang:
menu.txt
Component:
harbour
Doc. source:
.\doc\en\menu.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Display a menu item on screen and define a message
Syntax:
__AtPrompt( , , , [] ) --> .F.
Arguments:
is the row number to display the menu . Value could
range from zero to MAXROW().
is the column number to display the menu . Value
could range from zero to MAXCOL().
is the menu item character string to display.
define a message to display each time this menu item is
highlighted. could be a character string or code block that
is evaluated to a character string. If is not specified or
of the wrong type, an empty string ("") would be used.
Returns:
__AtPrompt() always return .F.
Description:
With __AtPrompt() you define and display a menu item, each call to
__AtPrompt() add another item to the menu, to start the menu itself
you should call the __MenuTo() function (MENU TO command). You can
define any row and column combination and they will be displayed at
the order of definition. After each call to __AtPrompt(), the cursor
is placed one column to the right of the last text displayed, and
ROW() and COL() are updated.
@...PROMPT command is preprocessed into __AtPrompt() function during
compile time.
Examples:
// display a two line menu with status line at the bottom
// let the user select favorite day
SET MESSAGE TO 24 CENTER
@ 10, 2 PROMPT "Sunday" MESSAGE "This is the 1st item"
@ 11, 2 PROMPT "Monday" MESSAGE "Now we're on the 2nd item"
MENU TO nChoice
DO CASE
CASE nChoice == 0 // user press Esc key
QUIT
CASE nChoice == 1 // user select 1st menu item
? "Guess you don't like Mondays"
CASE nChoice == 2 // user select 2nd menu item
? "Just another day for some"
ENDCASE
Create a new database based on current database structure
Syntax:
__dbCopyStruct( , [] )
Arguments:
is the name of the new database file to create. (.dbf)
is the default extension if none is given.
is an array where each element is a field name.
Names could be specified as uppercase or lowercase.
Returns:
Description:
__dbCopyStruct() create a new empty database file with a structure
that is based on the currently open database in this work-area. If
is empty, the newly created file would have the same
structure as the currently open database. Else, the new file would
contain only fields that exactly match .
__dbCopyStruct() can be use to create a sub-set of the currently
open database, based on a given field list.
COPY STRUCTURE command is preprocessed into __dbCopyStruct()
function during compile time.
Examples:
// Create a new file that contain the same structure
USE TEST
__dbCopyStruct( "mycopy.dbf" )
// Create a new file that contain part of the original structure
LOCAL aList
USE TEST
aList := { "NAME" }
__dbCopyStruct( "onlyname.dbf", aList )
Copy current database structure into a definition file
Syntax:
__dbCopyXStruct( ) --> lSuccess
Arguments:
is the name of target definition file to create. (.dbf)
is the default extension if none is given.
Returns:
__dbCopyXStruct() returns .F. if no database is USED in the current
work-area, .T. on success, or a run-time error if the file create
operation had failed.
Description:
__dbCopyXStruct() create a new database named with a
pre-defined structure (also called "structure extended file"):
Field name Type Length Decimals
FIELD_NAME C 10 0
FIELD_TYPE C 1 0
FIELD_LEN N 3 0
FIELD_DEC N 3 0
Each record in the new file contains information about one field in
the original file. CREATE FROM could be used to create a database
from the structure extended file.
For prehistoric compatibility reasons, Character fields which are
longer than 255 characters are treated in a special way by writing
part of the length in the FIELD_DEC according to the following
formula (this is done internally):
FIELD->FIELD_DEC := int( nLength / 256 )
FIELD->FIELD_LEN := ( nLength % 256 )
Later if you want to calculate the length of a field you can use
the following formula:
nLength := IIF( FIELD->FIELD_TYPE == "C", ;
FIELD->FIELD_DEC * 256 + FIELD->FIELD_LEN, ;
FIELD->FIELD_LEN )
COPY STRUCTURE EXTENDED command is preprocessed into
__dbCopyXStruct() function during compile time.
Examples:
// Open a database, then copy its structure to a new file,
// Open the new file and list all its records
USE Test
__dbCopyXStruct( "TestStru" )
USE TestStru
LIST
Create structure extended file or use one to create new file
Syntax:
__dbCreate( , [], [], [], [] ) --> lUsed
Arguments:
is the target file name to create and then open. (.dbf)
is the default extension if none is given.
is an optional structure extended file name from which
the target file is going to be built. If omitted, a new
empty structure extended file with the name is created
and opened in the current work-area.
is RDD name to create target with. If omitted, the
default RDD is used.
is an optional logical expression, (.T.) opens the target file
name in the next available unused work-area and makes
it the current work-area. (.F.) opens the target file in the current
work-area. Default value is (.F.). The value of is ignored if
is not specified.
is an optional alias to USE the target file with. If not
specified, alias is based on the root name of .
Returns:
__dbCreate() returns (.T.) if there is database USED in the
current work-area (this might be the newly selected work-area), or
(.F.) if there is no database USED. Note that on success a (.T.)
would be returned, but on failure you probably end up with a
run-time error and not a (.F.) value.
Description:
__dbCreate() works in two modes depending on the value of :
1) If is empty or not specified a new empty
structure extended file with the name is created and
then opened in the current work-area ( is ignored). The new
file has the following structure:
Field name Type Length Decimals
FIELD_NAME C 10 0
FIELD_TYPE C 1 0
FIELD_LEN N 3 0
FIELD_DEC N 3 0
The CREATE command is preprocessed into the __dbCopyStruct() function
during compile time and uses this mode.
2) If is specified, it is opened and assumed to
be a structure extended file where each record contains at least the
following fields (in no particular order): FIELD_NAME, FIELD_TYPE,
FIELD_LEN and FIELD_DEC. Any other field is ignored. From this
information the file is then created and opened in the
current or new work-area (according to ), if this is a new
work-area it becomes the current.
For prehistoric compatibility reasons, structure extended file
Character fields which are longer than 255 characters should be
treated in a special way by writing part of the length in the
FIELD_DEC according to the following formula:
FIELD->FIELD_DEC := int( nLength / 256 )
FIELD->FIELD_LEN := ( nLength % 256 )
CREATE FROM command is preprocessed into __dbCopyStruct() function
during compile time and use this mode.
Examples:
// CREATE a new structure extended file, append some records and
// then CREATE FROM this file a new database file
__dbCreate( "template" )
dbAppend()
FIELD->FIELD_NAME := "CHANNEL"
FIELD->FIELD_TYPE := "N"
FIELD->FIELD_LEN := 2
FIELD->FIELD_DEC := 0
dbAppend()
FIELD->FIELD_NAME := "PROGRAM"
FIELD->FIELD_TYPE := "C"
FIELD->FIELD_LEN := 20
FIELD->FIELD_DEC := 0
dbAppend()
FIELD->FIELD_NAME := "REVIEW"
FIELD->FIELD_TYPE := "C" // this field is 1000 char long
FIELD->FIELD_LEN := 232 // 1000 % 256 = 232
FIELD->FIELD_DEC := 3 // 1000 / 256 = 3
dbCloseArea()
__dbCreate( "TV_Guide", "template" )
Copies the contents of a database to a delimited text file or
appends the contents of a delimited text file to a database.
Syntax:
__dbDelim( , , [], [],
[], [], [], [], )
Arguments:
If set to .T., copies records to a delimited file.
If set to .F., append records from a delimited file.
The name of the text file to copy to or append from.
If a file extension is not specified, ".txt" is used by default.
Either the character to use as the character field
delimiter (only the first character is used). or "BLANK" (not case
sensitive), which eliminates the character field delimiters and
sets the field separator to a single space instead of a comma.
An aray of field names to limit the processint to. If
not specified, or if empty, then all fields are processed.
An optional code block containing a FOR expression that
will reduce the number of records to be processed.
An optional code block containing a WHILE expression
that will reduce the number of records to be processed.
If present, but nRecord is not present, specifies to
process this number of records, starting with the current record.
A value of 0 means to process no records.
If present, specifies the only record to process. A
value of 0 means to process no records. Overrides and .
If is .T., then if is set to .T. and there are no
, , or arguments, processes all records from
current to last.
Returns:
Description:
__dbDelim() copies all or selected contents of a database table
to an SDF text file or appends all or selected contents of an SDF
text file to a database table.
Examples:
// Copy delinquent accounts into a delimited text file.
USE ACCOUNTS NEW
COPY TO overdue DELIMITED FOR !Empty( accounts->duedate ) ;
.AND. DATE() - accounts->duedate > 30
// Import new customer records.
USE CUSTOMER NEW
APPEND FROM customer DELIMITED
Status:
S
Compliance:
C
Files:
See also:
__dbSDF(), APPEND FROM, COPY TO
__dbSDF()
Lang:
dbsdf.txt
Component:
harbour
Doc. source:
.\doc\en\dbsdf.txt
Template:
Procedure
Category:
API
Subcategory:
Database
Oneliner:
Copies the contents of a database to an SDF text file or
appends the contents of an SDF text file to a database.
Syntax:
__dbSDF( , , [],
[], [], [], [], )
Arguments:
If set to .T., copies records to an SDF file.
If set to .F., append records from an SDF file.
The name of the text file to copy to or append from.
If a file extension is not specified, ".txt" is used by default.
An aray of field names to limit the processint to. If
not specified, or if empty, then all fields are processed.
An optional code block containing a FOR expression that
will reduce the number of records to be processed.
An optional code block containing a WHILE expression
that will reduce the number of records to be processed.
If present, but is not present, specifies to
process this number of records, starting with the current record.
A value of 0 means to process no records.
If present, specifies the only record to process. A
value of 0 means to process no records. Overrides and .
If is .T., then if is set to .T. and there are no
, , or arguments, processes all records from
current to last.
Returns:
Description:
__dbSDF() copies all or selected contents of a database table
to an SDF text file or appends all or selected contents of an
SDF text file to a database table.
Examples:
// Copy delinquent accounts into an SDF text file.
USE ACCOUNTS NEW
COPY TO overdue SDF FOR !Empty( accounts->duedate ) ;
.AND. DATE() - accounts->duedate > 30
// Import new customer records.
USE CUSTOMER NEW
APPEND FROM customer SDF
Status:
S
Compliance:
C
Files:
See also:
__dbDelim(), APPEND FROM, COPY TO
__dbStructFilter()
Lang:
dbstrux.txt
Component:
harbour
Doc. source:
.\doc\en\dbstrux.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Filter a database structure array
Syntax:
__dbStructFilter( , [] ) --> aStructFiltered
Arguments:
is a multidimensional array with database fields
structure, which is usually the output from DBSTRUCT(), where each
array element has the following structure:
is an array where each element is a field name.
Names could be specified as uppercase or lowercase.
Returns:
__dbStructFilter() return a new multidimensional array where each
element is in the same structure as the original , but the
array is built according to the list of fields in . If
is empty, __dbStructFilter() return reference to the
original array.
Description:
__dbStructFilter() can be use to create a sub-set of a database
structure, based on a given field list.
Note that field names in MUST be specified in uppercase
or else no match would be found.
SET EXACT has no effect on the return value.
__dbStructFilter() is a Harbour extension. CA-Cl*pper has an internal
undocumented function named __FLEDIT() that does exactly the same
thing. The new name gives a better description of what this function does.
File mask to include in the function return. It could
contain path and standard wildcard characters as supported by your
OS (like * and ?). If contains no path, then SET DEFAULT
path is used to display files in the mask.
Returns:
__Dir() always returns NIL.
Description:
If no is given, __Dir() displays information about all
*.dbf in the SET DEFAULT path. This information contains: file name,
number of records, last update date and the size of each file.
If is given, __Dir() list all files that match the mask
with the following details: Name, Extension, Size, Date.
DIR command is preprocessed into __Dir() function during compile
time.
__Dir() is a compatibility function, it is superseded by DIRECTORY()
which return all the information in a multidimensional array.
Examples:
__Dir() // information for all DBF files in current directory
__Dir( "*.dbf" ) // list all DBF file in current directory
// list all PRG files in Harbour Run-Time library
// for DOS compatible operating systems
__Dir( "C:\harbour\source\rtl\*.prg" )
// list all files in the public section on a Unix like machine
__Dir( "/pub" )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
ADIR(),DIRECTORY(),SET DEFAULT,DIR
__FLEDIT()*
Lang:
dbstrux.txt
Component:
harbour
Doc. source:
.\doc\en\dbstrux.txt
Template:
Function
Category:
API
Subcategory:
Database
Oneliner:
Filter a database structure array
Syntax:
__FLEDIT( , [] ) --> aStructFiltered
Arguments:
is a multidimensional array with database fields
structure, which is usually the output from DBSTRUCT(), where each
array element has the following structure:
is an array where each element is a field name.
Names could be specified as uppercase or lowercase.
Returns:
__FLEDIT() return a new multidimensional array where each element is
in the same structure as the original , but the array is
built according to the list of fields in . If
is empty, __FLEDIT() return reference to the original
array.
Description:
__FLEDIT() can be use to create a sub-set of a database structure,
based on a given field list.
Note that field names in MUST be specified in uppercase
or else no match would found.
SET EXACT has no effect on the return value.
__FLEDIT() is a compatibility function and it is synonym for
__dbStructFilter() which does exactly the same.
CA-Cl*pper has internal undocumented function named __FLEDIT(),
in Harbour we name it __dbStructFilter(). The new name gives a better
description of what this function does. In Harbour __FLEDIT() simply
calls __dbStructFilter() and therefor the latter is the recommended
function to use.
This function is only visible if src/rdd/dbstrux.prg was compiled
with the HB_CLP_UNDOC flag.
This function waits for a console input and returns macroed
expression entered.
Examples:
Status:
S
Compliance:
C
Files:
Library is rtl
See also:
__WAIT(),__ACCEPT()
__KEYBOARD()
Lang:
input.txt
Component:
harbour
Doc. source:
.\doc\en\input.txt
Template:
Procedure
Category:
API
Subcategory:
User interface
Oneliner:
DO NOT CALL THIS FUNCTION DIRECTLY!
Syntax:
KEYBOARD
CLEAR TYPEAHEAD
Arguments:
is the optional string to stuff into the Harbour keyboard
buffer after clearing it first.
Note: The character ";" is converted
to CHR(13) (this is an undocumented CA-Cl*pper feature).
Returns:
Description:
Clears the Harbour keyboard typeahead buffer and then inserts an
optional string into it.
Examples:
// Stuff an Enter key into the keyboard buffer
KEYBOARD Chr(13)
// Clear the keyboard buffer
CLEAR TYPEAHEAD
Status:
R
Compliance:
__KEYBOARD() is compliant with CA-Cl*pper 5.3
Files:
Library is rtl
See also:
CLEAR TYPEAHEAD,KEYBOARD
__MenuTo()
Lang:
menu.txt
Component:
harbour
Doc. source:
.\doc\en\menu.txt
Template:
Function
Category:
API
Subcategory:
User interface
Oneliner:
Invoked a menu defined by set of @...PROMPT
Syntax:
__MenuTo( , ) --> nChoice
Arguments:
is a set/get code block for variable named .
is a character string that contain the name of the
variable to hold the menu choices, if this variable does not exist
a PRIVATE variable with the name would be created to
hold the result.
Returns:
__MenuTo() return the number of select menu item, or 0 if there was
no item to select from or if the user pressed the Esc key.
Description:
__MenuTo() invoked the menu define by previous __AtPrompt() call
and display a highlight bar that the user can move to select an
option from the menu. If does not exist or not visible,
a PRIVATE variable named is created and hold the current
menu selection. If there is a variable named , its value
is used to select the first highlighted item.
Menu prompts and messages are displayed in current Standard color,
highlighted bar is displayed using current Enhanced color.
Pressing the arrow keys move the highlighted bar. When a menu item
is highlighted the message associated with it is displayed on the
line specified with SET MESSAGE. If SET WRAP is ON and the user
press UP arrow while on the first selection the last menu item is
highlighted, if the user press Down arrow while on the last item,
the first item is highlighted.
Following are active keys that handled by __MenuTo():
key Meaning
Up Move to previous item
Down Move to next item
Left Move to previous item
Right Move to next item
Home Move to the first item
End Move to the last item
Page-Up Select menu item, return position
Page-Down Select menu item, return position
Enter Select menu item, return position
Esc Abort selection, return 0
First letter Select next menu with the same first letter,
| return this item position.
upon exit the cursor is placed at MAXROW()-1, 0
__MenuTo() can be nested without loosing the previous prompts.
MENU TO command is preprocessed into __MenuTo() function during
compile time.
Examples:
// display menu item on each screen corner and let user select one
CLS
SET MESSAGE TO MAXROW() / 2 CENTER
SET WRAP ON
@ 0 , 0 PROMPT "1. Upper left" MESSAGE " One "
@ 0 , MAXCOL()-16 PROMPT "2. Upper right" MESSAGE " Two "
@ MAXROW() - 1, MAXCOL()-16 PROMPT "3. Bottom right" MESSAGE "Three"
@ MAXROW() - 1, 0 PROMPT "4. Bottom left" MESSAGE "Four "
MENU TO nChoice
SETPOS( MAXROW() / 2, MAXCOL() / 2 - 10 )
IF nChoice == 0
?? "Esc was pressed"
ELSE
?? "Selected option is", nChoice
ENDIF
This function releases all PRIVATE and PUBLIC variables
Syntax:
__MVCLEAR()
Arguments:
None
Returns:
Nothing
Description:
This function releases all PRIVATE and PUBLIC variables.
It is used to implement CLEAR MEMORY statement.
The memory occupied by all visible variables are released - any
attempt to access the variable will result in a runtime error.
You have to reuse PRIVATE or PUBLIC statement to create again
the variable that was cleared by this function.
Examples:
Status:
R
Compliance:
H
Files:
Library is vm
See also:
__MVPUBLIC()
__MVDBGINFO()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Internal
Oneliner:
This function returns the information about the variables for debugger
Syntax:
__MVDBGINFO( [, [, @] ] )
Arguments:
= the scope of variables for which an information is asked
Supported values (defined in hbmemvar.ch)
HB_MV_PUBLIC
HB_MV_PRIVATE (or any other value)
= the position of asked variable on the list of variables
with specified scope - it should start from position 1
= the value is filled with a variable name if passed by
reference and is specified
Returns:
The return value depends on the number of arguments passed
Description:
This function retrieves the information about memvar variables.
It returns either the number of variables with given scope (when the
first argument is passed only) or a value of variable identified by its
position in the variables' list (when second argument is passed).
It also returns the name of a variable if optional third argument
is passed by reference.
If requested variable doesn't exist (requested position is
greater then the number of defined variables) then NIL value is
returned and variable name is set to "?"
The dynamic symbols table is used to find a PUBLIC variable then
the PUBLIC variables are always sorted alphabetically. The PRIVATE
variables are sorted in the creation order.
Note:
Due to dynamic nature of memvar variables there is no guarantee that
successive calls to retrieve the value of PUBLIC variable will
return the value of the same variable.
Examples:
#include "hbmemvar.ch"
LOCAL nCount, i, xValue, cName
nCount := _mvDBGINFO( HB_MV_PUBLIC )
FOR i := 1 TO nCount
xValue := __mvDBGINFO( HB_MV_PUBLIC, i, @cName )
? i, cName, xValue
NEXT
Status:
R
Compliance:
This function should be called from the debugger only.
Files:
Library is vm
See also:
__MVEXIST()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
Determine if a given name is a PUBLIC or PRIVATE memory variable
Syntax:
__MVEXIST( ) -->
Arguments:
- string that specifies the name of variable to check
Returns:
__MVEXIST() return TRUE (.T.) if a MEMVAR named exist.
Description:
This function determine if a PUBLIC or PRIVATE variable with the
name exist or not.
This function returns the value of PRIVATE or PUBLIC variable if
this variable exists otherwise it generates a runtime error.
The variable is specified by its name passed as the function parameter.
Examples:
FUNCTION MEMVARBLOCK( cMemvar )
RETURN {| x | ;
iif( PCOUNT() == 0, ;
__MVGET( cMemvar ),;
__MVPUT( cMemvar, x ) ) }
Status:
R
Compliance:
H
Files:
Library is vm
See also:
__MVPUT()
__MVPRIVATE()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
This function creates a PRIVATE variable
Syntax:
__MVPRIVATE( )
Arguments:
= either a string that contains the variable's name or
an one-dimensional array of strings with variable names
No skeleton are allowed here.
Returns:
Nothing
Description:
This function can be called either by the harbour compiler or by user.
The compiler always passes the item of IT_SYMBOL type that stores the
name of variable.
If a variable with the same name exists already then the value of old
variable is hidden until the new variable is released. The new variable
is always initialized to NIL value.
Examples:
None Avaliable
Status:
R
Compliance:
H
Files:
Library is vm
See also:
__MVPUBLIC()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
This function creates a PUBLIC variable
Syntax:
__MVPUBLIC( )
Arguments:
= either a string that contains the variable's name or
an one-dimensional array of strings with variable names
No skeleton are allowed here.
Returns:
Nothing
Description:
This function can be called either by the harbour compiler or by user.
The compiler always passes the item of IT_SYMBOL type that stores the
name of variable.
If a variable with the same name exists already then the new
variable is not created - the previous value remains unchanged.
If it is first variable with this name then the variable is
initialized with .T. value.
Examples:
None Avaliable
Status:
R
Compliance:
H
Files:
Library is vm
See also:
__MVPUT()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
This function set the value of memory variable
Syntax:
__MVGET( [, ] ) -->
Arguments:
- string that specifies the name of variable
- a value of any type that will be set - if it is not
specified then NIL is assumed
Returns:
A value assigned to the given variable.
Description:
This function sets the value of PRIVATE or PUBLIC variable if
this variable exists otherwise it generates a runtime error.
The variable is specified by its name passed as the function
parameter.
If a value is not specified then the NIL is assumed
Examples:
FUNCTION MEMVARBLOCK( cMemvar )
RETURN {| x | ;
iif( PCOUNT() == 0, ;
__MVGET( cMemvar ),;
__MVPUT( cMemvar, x ) ) }
Status:
R
Compliance:
H
Files:
Library is vm
See also:
__MVPUT()
__MVRELEASE()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
This function releases PRIVATE variables
Syntax:
__MVRELEASE( , )
Arguments:
= string that contains the wildcard mask for variables' names
that will be released. Supported wildcards: '*' and '?'
= logical value that specifies if variables
that match passed skeleton should be either included in deletion
(if .T.) or excluded from deletion (if .F.)
Returns:
Nothing
Description:
This function releases values stored in memory variables. It shouldn't
be called directly, it should be placed into RELEASE ALL command.
If the released variable is a PRIVATE variable then previously hidden
variable with the same name becomes visible after exit from the
procedure where released variable was created. If you access
the released variable in the same function/procedure where it
was created the the NIL value is returned. You can however assign
a new value to released variable without any side effects.
PUBLIC variables are not changed by this function.
Examples:
None Avaliable
Status:
R
Compliance:
H
Files:
Library is vm
See also:
__MVSCOPE()
Lang:
var.txt
Component:
harbour
Doc. source:
.\doc\en\var.txt
Template:
Function
Category:
API
Subcategory:
Variable management
Oneliner:
If variable exists then returns its scope.
Syntax:
__MVSCOPE( )
Arguments:
= a string with a variable name to check
Returns:
The symbolic values are defined in include/hbmemvar.ch
HB_MV_NOT_FOUND =variable is not declared (not found in symbol table)
HB_MV_UNKNOWN =if variable doesn't exist (but found in symbol table)
HB_MV_ERROR =if information cannot be obtained (memory error
or argument error)
HB_MV_PUBLIC =for public variables
HB_MV_PRIVATE_GLOBAL =for private variables declared outside of current
function/procedure
HB_MV_PRIVATE_LOCAL =for private variables declared in current
function/procedure
This function releases value stored in PRIVATE or PUBLIC variable
Syntax:
__MVXRELEASE( )
Arguments:
= either a string that contains the variable's name or
an one-dimensional array of strings with variable names
No skeleton are allowed here.
Returns:
Nothing
Description:
This function releases values stored in memory variable. It shouldn't
be called directly, rather it should be placed into RELEASE command.
If the released variable is a PRIVATE variable then previously hidden
variable with the same name becomes visible after exit from the
procedure where released variable was created. If you access
the released variable in the same function/procedure where it
was created the the NIL value is returned. You can however assign
a new value to released variable without any side effects.
It releases variable even if this variable was created in different
procedure
Examples:
PROCEDURE Main()
PRIVATE mPrivate
mPrivate :="PRIVATE from MAIN()"
? mPrivate //PRIVATE from MAIN()
Test()
? mPrivate //PRIVATE from MAIN()
RETURN
PROCEDURE Test()
PRIVATE mPrivate
mPrivate :="PRIVATE from Test()"
? mPrivate //PRIVATE from TEST()
RELEASE mPrivate
? mPrivate //NIL
mPrivate :="Again in Test()"
RETURN
Status:
R
Compliance:
H
Files:
Library is vm
See also:
__NONOALERT()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Procedure
Category:
API
Subcategory:
User interface
Oneliner:
Override //NOALERT command line switch
Syntax:
__NONOALERT()
Arguments:
This function takes no arguments.
Returns:
Description:
The //NOALERT command line switch cause Clipper to ignore calls to
the ALERT() function, this function override this behavior
and always display ALERT() dialog box.
Examples:
// make sure alert are been displayed
__NONOALERT()
Status:
R
Compliance:
C52U
Files:
Library is rtl
See also:
__objAddData()
Lang:
objfunc.txt
Component:
harbour
Doc. source:
.\doc\en\objfunc.txt
Template:
Function
Category:
API
Subcategory:
Objects
Oneliner:
Add a DATA to an already existing class
Syntax:
__objAddData( , ) --> oObject
Arguments:
is the object to work on.
is the symbol name of the new DATA to add.
Returns:
__objAddData() return a reference to .
Description:
__objAddData() is a low level class support function that add a new
DATA to an object. is unchanged if a symbol with the name
already exist in .
Examples:
// create a new THappy class and add a lHappy DATA
oHappy := HBClass():New( "THappy" )
__objAddData( oHappy, "lHappy" )
oHappy:lHappy := .T.
IF oHappy:lHappy
? "Happy, Happy, Joy, Joy !!!"
ELSE
? ":(..."
ENDIF
is the object to work on.
is the symbol name of the new INLINE to add.
is a code block to associate with the INLINE method.
Returns:
__objAddInline() return a reference to .
Description:
__objAddInline() is a low level class support function that add a
new INLINE method to an object. is unchanged if a symbol
with the name already exist in .
is the object to work on.
is the symbol name of the new METHOD to add.
is a pointer to a function to associate with the method.
Returns:
__objAddMethod() return a reference to .
Description:
__objAddMethod() is a low level class support function that add a
new METHOD to an object. is unchanged if a symbol with the
name already exist in .
Note that is a special pointer to a function that was
created using the @ operator, see example below.
Examples:
// create a new THappy class and add a Smile method
oHappy := HBClass():New( "THappy" )
__objAddMethod( oHappy, "Smile", @MySmile() )
? oHappy:Smile( 1 ) // :)
? oHappy:Smile( 2 ) // ;)
? oHappy:Smile( 3 ) // *SMILE*
STATIC FUNCTION MySmile( nType )
LOCAL cSmile
DO CASE
CASE nType == 1
cSmile := ":)"
CASE nType == 2
cSmile := ";)"
CASE nType == 3
cSmile := "*SMILE*"
ENDCASE
RETURN cSmile
is the object to work on.
is the symbol name of DATA to be deleted (removed) from
the object.
Returns:
__objDelData() return a reference to .
Description:
__objDelData() is a low level class support function that delete
(remove) a DATA from an object. is unchanged if a symbol
with the name does not exist in .
Examples:
// create a new THappy class and add a lHappy DATA
oHappy := HBClass():New( "THappy" )
__objAddData( oHappy, "lHappy" )
? __objHasData( oHappy, "lHappy" ) // .T.
// remove lHappy DATA
__objDelData( oHappy, "lHappy" )
? __objHasData( oHappy, "lHappy" ) // .F.
is the object to work on.
is the symbol name of METHOD or INLINE method to be
deleted (removed) from the object.
Returns:
__objDelInMethod() return a reference to .
Description:
__objDelInMethod() is a low level class support function that delete
(remove) a METHOD or an INLINE method from an object. is
unchanged if a symbol with the name does not exist in
.
Examples:
// create a new THappy class and add a Smile method
oHappy := HBClass():New( "THappy" )
__objAddMethod( oHappy, "Smile", @MySmile() )
? __objHasMethod( oHappy, "Smile" ) // .T.
// remove Smile method
__objDelInMethod( oHappy, "Smile" )
? __objHasMethod( oHappy, "Smile" ) // .F.
STATIC FUNCTION MySmile( nType )
LOCAL cSmile
DO CASE
CASE nType == 1
cSmile := ":)"
CASE nType == 2
cSmile := ";)"
ENDCASE
RETURN cSmile
is the object to work on.
is the symbol name of METHOD or INLINE method to be
deleted (removed) from the object.
Returns:
__objDelMethod() return a reference to .
Description:
__objDelMethod() is a low level class support function that deletes
(removes) a METHOD or an INLINE method from an object. is
unchanged if a symbol with the name does not exist in
.
__objDelInline() is exactly the same as __objDelMethod().
Examples:
// create a new THappy class and add a Smile method
oHappy := HBClass():New( "THappy" )
__objAddMethod( oHappy, "Smile", @MySmile() )
? __objHasMethod( oHappy, "Smile" ) // .T.
// remove Smile method
__objDelMethod( oHappy, "Smile" )
? __objHasMethod( oHappy, "Smile" ) // .F.
STATIC FUNCTION MySmile( nType )
LOCAL cSmile
DO CASE
CASE nType == 1
cSmile := ":)"
CASE nType == 2
cSmile := ";)"
ENDCASE
RETURN cSmile
Determine whether a class is derived from another class
Syntax:
__objDerivedFrom( , ) --> lIsParent
Arguments:
is the object to check.
is the object that may be a parent. can be either
an Object or a Character string with the class name.
Returns:
__objDerivedFrom() return a logical TRUE (.T.) if is
derived from .
Description:
__objDerivedFrom() is a low level class support function that check
is one class is a super class of the other, or in other words, does
class a child or descendant of .
Examples:
// Create three classes and check their relations
#include "hbclass.ch"
PROCEDURE Main()
LOCAL oSuper, oObject, oDress
oSuper := TMood():New()
oObject := THappy():New()
oDress := TShirt():New()
? __objDerivedFrom( oObject, oSuper ) // .T.
? __objDerivedFrom( oSuper, oObject ) // .F.
? __objDerivedFrom( oObject, oDress ) // .F.
RETURN
CREATE CLASS TMood
METHOD New() INLINE Self
ENDCLASS
CREATE CLASS THappy FROM TMood
METHOD Smile() INLINE qout( "*smile*" )
ENDCLASS
CREATE CLASS TShirt
VAR Color
VAR Size
METHOD New() INLINE Self
ENDCLASS
Status:
R
Compliance:
H
Files:
Library is rtl
See also:
__objHasData(),__ObjHasMethod()
__objGetMethodList()
Lang:
objfunc.txt
Component:
harbour
Doc. source:
.\doc\en\objfunc.txt
Template:
Function
Category:
API
Subcategory:
Objects
Oneliner:
Return names of all METHOD for a given object
Syntax:
__objGetMethodList( ) --> aMethodNames
Arguments:
is an object to scan.
Returns:
__objGetMethodList() return an array of character stings with all
METHOD names for a given object. __objGetMethodList() would return
an empty array {} if the given object does not contain any METHOD.
Description:
__objGetMethodList() is a low level class support function that let
you find all class functions names for a given object.
It is equivalent to __objGetMsgList( oObject, .F. ).
Examples:
// show information about TBrowse class
oB := TBrowseNew( 0, 0, 24, 79 )
aMethod := __objGetMethodList( oB )
FOR i := 1 TO Len( aMethod )
? "METHOD name:", aMethod[ i ]
NEXT
Return names of all DATA or METHOD for a given object
Syntax:
__objGetMsgList( , [], [nClassType] ) --> aNames
Arguments:
is an object to scan.
is an optional logical value that specifies the information
to return. A value of .T. instruct the function to return list of
all DATA names, .F. return list of all METHOD names. Default value
is .T.
is on optional numeric code for selecting which class
type to return. Default value is HB_MSGLISTALL, returning the whole
list.
Returns:
__objGetMsgList() return an array of character stings with all DATA
names or all METHOD names for a given object. __objGetMsgList()
would return an empty array {} if the given object does not contain
the requested information.
Description:
__objGetMsgList() is a low level class support function that let you
find all instance variable or method names for a given object.
If specified, the following table shows the values for
that allow you to distinguish between DATA and CLASSDATA:
table>
hboo.ch Value Meaning
HB_MSGLISTALL 0 All types
HB_MSGLISTCLASS 1 CLASSDATA only
HB_MSGLISTPURE 2 DATA only
/table>
DATA are instance variable usable within each object from a class,
where each object has its own DATAs.
CLASSDATA are shared by all objects from a Class, so the changed
value within Object1 will be reflected when accessing the CLASSDATA
from Object2.
Examples:
// show information about TBrowse class
oB := TBrowseNew( 0, 0, 24, 79 )
aData := __objGetMsgList( oB, .T. )
aClassData := __objGetMsgList( oB, .T., HB_MSGLISTCLASS )
aMethod := __objGetMsgList( oB, .F. )
FOR i := 1 TO Len( aData )
? "DATA name:", aData[ i ]
NEXT
FOR i := 1 TO Len( aClassData )
? "CLASSDATA name:", aClassData[ i ]
NEXT
FOR i := 1 TO Len( aMethod )
? "METHOD name:", aMethod[ i ]
NEXT
Return an array of DATA names and values for a given object
Syntax:
__objGetValueList( , [] ) --> aData
Arguments:
is an object to scan.
is an optional array with DATA names you want to exclude
from the scan.
Returns:
__objGetValueList() return a 2D array that contain pairs of a DATA
symbol name and the value of DATA. __objGetValueList() would return
an empty array {} if the given object does not contain the requested
information.
Description:
__objGetValueList() is a low level class support function that
return an array with DATA names and value, each array element is a
pair of: aData[ i, HB_OO_DATA_SYMBOL ] contain the symbol name
aData[ i, HB_OO_DATA_VALUE ] contain the value of DATA
Examples:
// show information about TBrowse class
oB := TBrowseNew( 0, 0, 24, 79 )
aData := __objGetValueList( oB )
FOR i := 1 TO len( aData )
? "DATA name:", aData[ i, HB_OO_DATA_SYMBOL ], ;
" value=", aData[ i, HB_OO_DATA_VALUE ]
NEXT
Determine whether a symbol exist in object as DATA
Syntax:
__objHasData( , ) --> lExist
Arguments:
is an object to scan.
is the name of the symbol to look for.
Returns:
__objHasData() return .T. if the given exist as DATA
(instance variable) in object
Description:
__objHasData() is a low level class support function that let you
find out if a symbol is an instance variable in a given object.
Examples:
oB := TBrowseNew( 0, 0, 24, 79 )
? __objHasData( oB, "nLeft" ) // this should return .T.
? __objHasData( oB, "lBugFree" ) // hopefully this should be .F.
? __objHasData( oB, "Left" ) // .F. since this is a METHOD
Determine whether a symbol exist in object as METHOD
Syntax:
__objHasMethod( , ) --> lExist
Arguments:
is an object to scan.
is the name of the symbol to look for.
Returns:
__objHasMethod() return .T. if the given exist as METHOD
(class function) in object
Description:
__objHasMethod() is a low level class support function that let you
find out if a symbol is a class function in a given object.
Examples:
oB := TBrowseNew( 0, 0, 24, 79 )
? __objHasMethod( oB, "nLeft" ) // .F. since this is a DATA
? __objHasMethod( oB, "FixBugs" ) // hopefully this should be .F.
? __objHasMethod( oB, "Left" ) // this should return .T.
Modify (replace) an INLINE method in an already existing class
Syntax:
__objModInline( , , ) --> oObject
Arguments:
is the object to work on.
is the symbol name of the INLINE method to modify.
is a new code block to associate with the INLINE method.
Returns:
__objModInline() return a reference to .
Description:
__objModInline() is a low level class support function that modify
an INLINE method in an object and replace it with a new code block.
is unchanged if a symbol with the name does
not exist in . __objModInline() is used in inheritance
mechanism.
Modify (replace) a METHOD in an already existing class
Syntax:
__objModMethod( , , ) --> oObject
Arguments:
is the object to work on.
is the symbol name of the METHOD to modify.
is a pointer to a new function to associate with the
method.
Returns:
__objModMethod() return a reference to .
Description:
__objModMethod() is a low level class support function that modify
a METHOD in an object and replace it with a new function.
is unchanged if a symbol with the name does not exist
in . __objModMethod() is used in inheritance mechanism.
Note that is a special pointer to a function that was
created using the @ operator, see example below.
Examples:
// create a new THappy class and add a Smile method
oHappy := HBClass():New( "THappy" )
__objAddMethod( oHappy, "Smile", @MySmile() )
? oHappy:Smile( 1 ) // :)
? oHappy:Smile( 2 ) // ;)
// replace Smile method with a new function
__objAddMethod( oHappy, "Smile", @YourSmile() )
? oHappy:Smile( 1 ) // *SMILE*
? oHappy:Smile( 2 ) // *WINK*
STATIC FUNCTION MySmile( nType )
LOCAL cSmile
DO CASE
CASE nType == 1
cSmile := ":)"
CASE nType == 2
cSmile := ";)"
ENDCASE
RETURN cSmile
STATIC FUNCTION YourSmile( nType )
LOCAL cSmile
DO CASE
CASE nType == 1
cSmile := "*SMILE*"
CASE nType == 2
cSmile := "*WINK*"
ENDCASE
RETURN cSmile
is an object to set.
is a 2D array with a pair of instance variables and values
for setting those variable.
Returns:
__ObjSetValueList() return a reference to .
Description:
__ObjSetValueList() is a low level class support function that let
you set a group of instance variables with values. each array
element in is a pair of:
aData[ i, HB_OO_DATA_SYMBOL ] which contain the variable name to set
aData[ i, HB_OO_DATA_VALUE ] contain the new variable value.
This function terminates the current application and returns
to the system.
Examples:
See Test
Status:
R
Compliance:
C
Files:
Library is vm
See also:
QUIT
__RUN()
Lang:
misc.txt
Component:
harbour
Doc. source:
.\doc\en\misc.txt
Template:
Procedure
Category:
API
Subcategory:
Environment
Oneliner:
Run an external program.
Syntax:
__RUN( )
Arguments:
Command to execute.
Returns:
Description:
This command runs an external program. Ensure that
you have enough free memory to be able to run the external
program. Do not use it to run 'Terminate and Stay Resident' programs
(in case of DOS) since that causes several problems.
Note: This function is what the RUN command preprocesses into.
It is considered bad form to use this function directly.
Use the RUN command instead.
Examples:
__run( "edit " + cMyTextFile ) // Runs an external editor
__run( "command" ) // Gives a DOS shell (DOS only)
Status:
R
Compliance:
C
Files:
src/rtl/run.c
Library is rtl
See also:
RUN
__SETCENTURY()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Environment
Oneliner:
Set the Current Century
Syntax:
__SETCENTURY([ | ] ) --> lPreviousValue
Arguments:
optional or (not case sensitive)
.T. or "ON" to enable the century setting (4-digit years)
.F. or "OFF" to disable the century setting (2-digit years)
Returns:
Either the current or previous century setting as a logical value
Description:
Examples:
Status:
Compliance:
C
Files:
Library is rtl
See also:
__SetFunction()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Events
Oneliner:
Assign a character string to a function key
Syntax:
__SetFunction( , [] ) --> NIL
Arguments:
is a number in the range 1..40 that represent the
function key to be assigned.
is a character string to set. If is not
specified, the function key is going to be set to NIL releasing by
that any previous __SetFunction() or SETKEY() for that function.
Returns:
__SetFunction() always return NIL.
Description:
__SetFunction() assign a character string with a function key, when
this function key is pressed, the keyboard is stuffed with this
character string. __SetFunction() has the effect of clearing any
SETKEY() previously set to the same function number and vice versa.
nFunctionKey Key to be set
1 .. 12 F1 .. F12
13 .. 20 Shift-F3 .. Shift-F10
21 .. 30 Ctrl-F1 .. Ctrl-F10
31 .. 40 Alt-F1 .. Alt-F10
SET FUNCTION command is preprocessed into __SetFunction() function
during compile time.
Examples:
// Set F1 with a string
CLS
__SetFunction( 1, "I Am Lazy" + CHR( 13 ) )
cTest := SPACE( 20 )
@ 10, 0 SAY "type something or F1 for lazy mode " GET cTest
READ
? cTest
Status:
R
Compliance:
Harbour use 11 and 12 to represent F11 and F12, while CA-Cl*pper use
11 and 12 to represent Shift-F1 and Shift-F2.
Files:
Library is rtl
See also:
INKEY(),SETKEY(),__Keyboard(),SET KEY
__SetHelpK()
Lang:
hvm.txt
Component:
harbour
Doc. source:
.\doc\en\hvm.txt
Template:
Procedure
Category:
API
Subcategory:
Internal
Oneliner:
Set F1 as the default help key
Syntax:
__SetHelpK()
Arguments:
None.
Returns:
Description:
Set F1 to execute a function called HELP if such a function is
linked into the program.
Examples:
Status:
R
Compliance:
C
Files:
Library is vm
See also:
__XHelp(),SET KEY,SETKEY()
__TextRestore()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Procedure
Category:
API
Subcategory:
Internal
Oneliner:
Restore console output settings as saved by __TextSave()
Syntax:
__TextRestore()
Arguments:
none.
Returns:
Description:
__TextRestore() is used in the preprocessing of the TEXT TO command
to restore console output settings that were previously saved by
__TextSave().
Examples:
Status:
R
Compliance:
C52U
Files:
Library is rtl
See also:
SET(),SET ALTERNATE,SET PRINTER,TEXT,__TextSave()
__TextSave()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Procedure
Category:
API
Subcategory:
Internal
Oneliner:
Redirect console output to printer or file and save old settings
Syntax:
__TextSave( )
Arguments:
is either "PRINTER" (note the uppercase) in which console
output is SET to PRINTER, or a name of a text file with a default
".txt" extension, that is used to redirect console output.
Returns:
Description:
__TextSave() is used in the preprocessing of the TEXT TO command to
redirect the console output while saving old settings that can be
restored later by __TextRestore().
Show the content of a file on the console and/or printer
Syntax:
__TYPEFILE( , [] ) --> NIL
Arguments:
is a name of the file to display. If the file have an
extension, it must be specified (there is no default value).
is an optional logical value that specifies whether the
output should go only to the screen (.F.) or to both the screen and
printer (.T.), the default is (.F.).
Returns:
__TYPEFILE() always return NIL.
Description:
__TYPEFILE() function type the content of a text file on the screen
with an option to send this information also to the printer. The
file is displayed as is without any headings or formatting.
If contain no path, __TYPEFILE() try to find the file first
in the SET DEFAULT directory and then in search all of the SET PATH
directories. If can not be found a run-time error occur.
Use SET CONSOLE OFF to suppress screen output.
You can pause the output using Ctrl-S, press any key to resume.
__TYPEFILE() function is used in the preprocessing of the TYPE
command.
Examples:
The following examples assume a file name mytext.dat exist in all
specified paths, a run-time error would displayed if it does not
// display mytext.dat file on screen
__TYPEFILE( "mytext.dat" )
// display mytext.dat file on screen and printer
__TYPEFILE( "mytext.dat", .T. )
// display mytext.dat file on printer only
SET CONSOLE OFF
__TYPEFILE( "mytext.dat", .T. )
SET CONSOLE ON
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
COPY FILE,SET DEFAULT,SET PATH,SET PRINTER,TYPE
__WAIT()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Function
Category:
API
Subcategory:
Events
Oneliner:
Stops the application until a key is pressed.
Syntax:
__WAIT( ) -->
Arguments:
is a string.
Returns:
Pressed key.
Description:
This function stops the application until a key is pressed. The key
must be in the range 32..255. Control keys are not processed.
Examples:
// Wait for a key stroke
__Wait( "Press a key to continue" )
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
__ACCEPT(),__INPUT()
__XHELP()
Lang:
set.txt
Component:
harbour
Doc. source:
.\doc\en\set.txt
Template:
Function
Category:
API
Subcategory:
Internal
Oneliner:
Determines whether a Help() user defined function exists.
Syntax:
__XHELP() -->
Arguments:
None
Returns:
This function returns aleatory values.
Description:
This is an internal undocumented CA-Cl*pper function, which will
try to call the user defined function HELP() if it is defined
in the current application. This is the default SetKey() handler
for the F1 key.
Examples:
Status:
R
Compliance:
C52U
Files:
Library is rtl
See also:
__XRestScreen()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Procedure
Category:
API
Subcategory:
User interface
Oneliner:
Restore screen image and coordinate from an internal buffer
Syntax:
__XRestScreen()
Arguments:
none.
Returns:
Description:
__XRestScreen() restore saved image of the whole screen from an
internal buffer that was saved by __XSaveScreen(), it also restore
cursor position. After a call to __XRestScreen() the internal buffer
is cleared.
RESTORE SCREEN command is preprocessed into __XRestScreen() function
during compile time. Note that RESTORE SCREEN FROM is preprocessed
into RESTSCREEN() function.
__XRestScreen() is a compatibility function, it is superseded by
RESTSCREEN() which allow you to restore the screen from a variable.
Examples:
// save the screen, display list of files than restore the screen
SAVE SCREEN
DIR *.*
WAIT
RESTORE SCREEN
Status:
R
Compliance:
C
Files:
Library is rtl
See also:
__XRESTSCREEN(),SAVE SCREEN,__XSAVESCREEN()
__XSaveScreen()
Lang:
terminal.txt
Component:
harbour
Doc. source:
.\doc\en\terminal.txt
Template:
Procedure
Category:
API
Subcategory:
User interface
Oneliner:
Save whole screen image and coordinate to an internal buffer
Syntax:
__XSaveScreen()
Arguments:
none.
Returns:
Description:
__XSaveScreen() save the image of the whole screen into an internal
buffer, it also save current cursor position. The information could
later be restored by __XRestScreen(). Each call to __XSaveScreen()
overwrite the internal buffer.
SAVE SCREEN command is preprocessed into __XSaveScreen() function
during compile time. Note that SAVE SCREEN TO is preprocessed into
SAVESCREEN() function.
__XSaveScreen() is a compatibility function, it is superseded by
SAVESCREEN() which allow you to save part or all the screen into a
variable.
Examples:
// save the screen, display list of files than restore the screen
SAVE SCREEN
DIR *.*
WAIT
RESTORE SCREEN